>_ RESTERM
v1.18.2

examples Protocols

graphql.http

Inline and file-based GraphQL requests, with queries and variables in queries/.

runs as-is

shell
resterm run --all _examples/graphql.http

Run this from the root of a clone of the Resterm repository.

Editor
### Inline GraphQL Query
# @name GraphQLFetchWorkspace
# @tag graphql workspaces
# @description Inline @graphql request with variables block.
# @graphql
# @operation FetchWorkspace
POST {{graphql.endpoint}}
Accept: application/json

query FetchWorkspace($id: ID!, $includeMembers: Boolean!) {
  workspace(id: $id) {
    id
    name
    region
    plan
    members @include(if: $includeMembers) {
      totalCount
      edges {
        node {
          id
          email
        }
      }
    }
  }
}

# @variables
{
  "id": "{{graphql.workspaceId}}",
  "includeMembers": true
}

### GraphQL With External Files
# @name GraphQLFromFiles
# @tag graphql files
# @description Loads query and variables via file references.
# @graphql
# @operation FetchWorkspace
# @query < ./queries/workspace.graphql
POST {{graphql.endpoint}}
Accept: application/json

# @variables < ./queries/workspace.variables.json

_examples/graphql.http on GitHub

GraphQL docs
Search

↑↓ moveEnter openEsc close

Help

These keys work like the ones in the TUI.

/
Search the docs (also Ctrl K)
j k
Scroll down and up
g g G
Jump to the top or the bottom
[ ]
Previous and next page
g d
Docs index
g h
Home page
t
Switch between dark and light
?
Show this help
Esc
Close a dialog