GraphQL
Last updated
Was this helpful?
Last updated
Was this helpful?
GraphQL is a strongly typed API query language that provides an alternative to REST. It allows clients to define the structure of the data required, and exactly the same structure of the data is returned from the server. This avoids both the problems of over and under-fetching data, while also allowing for a more powerful and flexible API.
When you make a request you'll need to include 2 payload objects, query
, and variables
.
query: contains your query or mutation strings.
variables: contains the variable values used within your query.
You can omit the variables object and instead hard-code your values inside your query, however, this is not recommended past the simplest of queries.
Below is a simple request that fetches a hentai by its ID.
This request will return the following JSON response: