All requests in Graphql are POST.
- Query -> get information
- Mutation -> change information
- Scalar types -> String, Int, Float, Boolean and ID
Line 2 is added but in apolloServer 3 disabled the graphql playground.
Running dev mode:
yarn dev
Open browser:
Query users example:
query{
users{
name
email
password
active
}
}
Query user by Email example:
query{
getUserbyEmail(email: "pedro@laxe.dev"){
name
email
}
}
Mutation to create new user example:
mutation{
createUser(name: "Jonas", email: "jonas@laxe.dev", password: "123456"){
name
email
}
}