GraphQL
Right-click in the tree ▸ Add ▸ GraphQL request.

Configuration
Section titled “Configuration”| Field | Role |
|---|---|
| URL | The GraphQL endpoint |
| Operation type | query, mutation or subscription |
| Query | The GraphQL document, with syntax highlighting |
| Variables | The operation’s variables, in JSON |
| Operation name | Required as soon as the document holds several named operations |
| Headers | As for an HTTP request |
Restorm {{variables}} work inside the document just as they do in the GraphQL
variables — take care not to confuse the two systems: $id is a GraphQL
variable, {{id}} a Restorm one.
Subscriptions
Section titled “Subscriptions”A subscription opens a stream: messages arrive as they come in the response
panel. In a scenario, the GraphQL
subscribe / GraphQL unsubscribe actions drive that same stream and emit one
event per message received.
Importing a schema
Section titled “Importing a schema”A .graphql / .gql (SDL) file creates a complete tree: one folder per
operation type, one request per root field, with argument variables pre-filled,
the API documentation and the enumerations. See
Importing a GraphQL schema.
Postman, Bruno, Insomnia and Thunder Client collections whose requests are of GraphQL type are imported as GraphQL requests, not as HTTP requests.
Server mode
Section titled “Server mode”Restorm can host a mock GraphQL server: you supply the schema (SDL) and,
optionally, canned values per field (Query.pets) or a JavaScript resolver
script that takes precedence over them. Subscriptions are served too. See
Mocking a GraphQL API.
Code snippets
Section titled “Code snippets”Thirteen targets: cURL, JavaScript (Fetch, Apollo Client), TypeScript, Python (Requests, gql), Go (graphql-go), Ruby (graphql-client), PHP (Guzzle), C# (GraphQL.Client), Java (graphql-java), Swift (Apollo iOS), Kotlin (Apollo Kotlin).