Why am I getting a “Cannot return null for non-nullable field” error when doing a mutation? [duplicate]

The biggest problem with your resolver is that in any number of scenarios, instead of returning a User object, you return a string. Your schema specifies that createAccount can return a User or null (if it was User!, it would be non-nullable and then null would not be a valid type either). When you return … Read more

How do I add a description to a field in “GraphQL schema language”

If you’re using GraphQL.js version 0.7.0 or above, you can simply add a comment directly before the field, type, or argument you want to describe. For example: # A type that describes the user type User { # The user’s username, should be typed in the login field. username: String! # The user’s password. password: … Read more