Make it more obvious that node is required for relay

Give the error message that occurs if you forget the node Field,
so googling for this brings you right to the documentation
This commit is contained in:
Joshua Schüler 2016-06-22 16:54:16 +02:00
parent 52dd103e6b
commit 9f15678767

View File

@ -54,6 +54,8 @@ class Query(graphene.ObjectType):
node = relay.NodeField()
```
If you encounter an error like `Cannot query field "node" on type "Query"`, you most likely forgot to add the `node` Field.
## Mutations
Most APIs don't just allow you to read data, they also allow you to write. In GraphQL, this is done using mutations. Just like queries, Relay puts some additional requirements on mutations, but Graphene nicely manages that for you. All you need to do is make your mutation a subclass of `relay.ClientIDMutation`.