Overview
Dgraph automatically generates GraphQL queries for each type that you define in your schema. There are three types of queries generated for each type.
We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.
How to use queries to fetch data from Dgraph.
Dgraph automatically generates GraphQL queries for each type that you define in your schema. There are three types of queries generated for each type.
Example
With this schema, there would be three queries generated for Post and three for Author. Here are the queries that are generated for the Post type:
The first query allows you to fetch a post and its related fields given an ID. The second query allows you to fetch a list of posts based on some filters, sorting and pagination parameters. The third query allows you to fetch aggregate parameters like count of nodes based on filters.
Additionally, a check<Type>Password
query is generated for types that have
been specified with a @secret
directive.
You can look at all the queries that are generated by using any GraphQL client such as Insomnia or GraphQL playground.
Was this page helpful?