GraphQL Notes
nexus is a javascript library for interacting with graphql
email: String! # Required string - cannot be null
email: String # Optional string - can be null
signup(...): AuthPayload! # This function ALWAYS returns an AuthPayload
signup(...): AuthPayload # This function might return null
users: [User!]! # Required array of required Users
users: [User] # Optional array that might contain nulls
this:
mutation {
signup(
username: "testuser"
password: "secret123"
email: "foo@bar.com"
) {
token
user {
id
}
}
}
means: "create a new user with these username, password and email values, then return the token and the user id"