Examples for GraphQL-Queries and Mutations
Here you can find examples for GraphQL-Queries and mutations to try out with one click. The database of the GraphQL service is reset periodically, so you can change the data with mutations as you like.
1.1. Return all Objects of a Type
1.2. Searching by ID
Use one of the methods mentioned above but with an id as argument.
1.3. Selection of Subfields
The returned objects are JSON-objects that can be quite complex. The fields of an object can itself be a JSON-object with fields of its own and so on. In a query you can specify which of these fields and subfields you want to return. If a field has subfields you have to make a selection of these subfields in order for the query to work.
1.4. Multiple Levels of nested Subfields
By selecting subfields you can build queries that have deep levels of subfield nesting. You can even include circles of subfields.
1.5. Filtering Fields
Besides the id you can give query methods additional arguments. The methods then only return objects which have in their fields values corresponding to the values of those arguments.
For the queries shown so far GraphiQL automatically started the query after a click on "Send Query". For the following mutations "Send Query" just opens GraphiQL and you have to send the Query yourself by clicking on the arrow symbol.
2.1. Add Mutations
You can add new objects of the main types with the corresponding add mutations. If you do this you have to provide all attributes for the object.
2.2. Update Mutations
Changes an object of a type specified by the provided id. You can change all or just certain attributes depending on which attributes you provide. The state of the object after the modification is returned as well.
2.3. Delete Mutations
Deletes object with provided id. The deleted object gets returned.