Configure Query
modal, you can specify your GraphQL query or mutation, as well as define any variable you need to use inside your request.
Check out the official GraphQL Documentation if you need some more information on how to write a GraphQL query.
Additionally, you can also set your authentication or any request headers that you need.
Variables
drawer at the bottom of the Edit Request
modal. As an example lets imagine that we have a route for fetching Rick & Morty characters via the https://rickandmortyapi.com GraphQL API and we filter these results by the name that we pass in via an query parameter to the fastgen route.
We would then enter the https://rickandmortyapi.com/graphql
as the url of the GraphQL action and then start of by defining a mapping to make the name
query parameter accessible within the query syntax.
name
of type string for which we just created a mapping. On the next line we then use the variable to filter all records using that name.
If we now call our fastgen route and pass in the name in the query either by specifying it in the url like /rickandmorty?name=rick
or by specifying it under URL Parameters > Query
in the request modal of the fastgen debug mode, we can see all filtered records being returned.