GraphQL
Rostyman has built-in GraphQL support with schema-aware editing, introspection, schema explorer, subscriptions, and full authentication support — all within regular request tabs.
Opening a GraphQL Request
- Create a new request tab (Ctrl+T) or open an existing one
- Set the method to POST and enter your GraphQL endpoint URL
- In the Body tab, switch the body mode dropdown to GraphQL
The tab switches to a dedicated GraphQL layout with a query editor, variables panel, and operation selector.
Query Editor
The query editor uses Monaco (the same engine as VS Code) with full GraphQL support:
| Feature | Description |
|---|---|
| Syntax highlighting | Distinct colors for operations, types, fields, directives, and arguments |
| Autocomplete | After schema introspection: fields, types, arguments, directives, and variables are suggested as you type. Trigger manually with Ctrl+Space. |
| Real-time validation | Syntax errors and schema violations are underlined with descriptive error messages |
| Bracket matching | Auto-closes braces and parentheses |
| Field type hints | Hover a field to see its type and description from the schema |
Example query:
query GetUser($id: ID!, $includeEmail: Boolean = false) {
user(id: $id) {
id
name
email @include(if: $includeEmail)
posts {
title
publishedAt
}
}
}
Variables Panel
Below the query editor, the Variables panel accepts a JSON object containing the values for your query's variables:
{
"id": "42",
"includeEmail": true
}
These are sent as the variables field in the GraphQL request body. Variables support Rostyman's {{variable}} syntax for referencing environment and collection variables:
{
"token": "{{auth_token}}",
"limit": 25
}
Operation Selector
When your document contains multiple named operations, a dropdown appears above the editor. Select which operation to execute — the selected name is sent as the operationName field in the request.
query GetUser($id: ID!) {
user(id: $id) { name }
}
mutation UpdateUser($id: ID!, $name: String!) {
updateUser(id: $id, name: $name) { id name }
}
query ListUsers {
users { id name }
}
Selecting "GetUser" sends only that operation even though all three are in the editor.
Headers
The Headers tab works identically to any HTTP request. Common headers for GraphQL:
| Header | Value |
|---|---|
Content-Type | application/json (set automatically) |
Authorization | Bearer {{auth_token}} |
x-api-key | {{api_key}} |
Collection-level auth inheritance applies to GraphQL requests. If the collection uses Bearer auth, the Authorization header is injected automatically unless the request overrides it.
Authentication
Authentication for GraphQL uses the same Auth tab as HTTP requests. All auth types work:
| Type | Usage |
|---|---|
| Bearer Token | Most GraphQL APIs — Authorization: Bearer ... |
| API Key | Via header or query param |
| Basic Auth | Username/password encoded as Base64 |
| OAuth 2.0 | Full OAuth flow with token refresh |
| No Auth | Public endpoints or auth handled in headers manually |
Auth can be set on the collection (inherited by all requests in it) or overridden per request.
Schema Introspection
Click the Introspect button (the refresh/schema icon near the query editor) to fetch and load the remote schema. Rostyman sends a standard introspection query to your endpoint and caches the resulting schema.
Once introspected, the schema powers:
- Field autocomplete within selection sets
- Argument names and type information
- Inline validation against the actual types
- The Schema Explorer panel (see below)
The schema is cached per-endpoint. Re-click Introspect when the remote schema changes.
Schema Explorer
After introspection, the Schema Explorer panel shows the full type tree:
- Query, Mutation, and Subscription root types listed at the top
- Each type is expandable to show its fields
- Each field shows its return type (right-aligned in muted text)
- Fields with arguments show the argument names in parentheses
- Click a leaf field to insert it at the cursor position in the query editor
- Type icons distinguish OBJECT (box), ENUM (list), SCALAR (hash), and INPUT_OBJECT (type) types
- A search input filters types and fields in real time
Response Viewer
GraphQL responses are shown in the standard response panel with full JSON syntax highlighting and formatting. Since GraphQL always returns HTTP 200 for application-level errors, check the response body for an errors array alongside data.
Subscriptions
Rostyman supports GraphQL subscriptions over WebSocket using the graphql-transport-ws subprotocol.
Setup
- Enter your subscription endpoint URL — usually
ws://orwss://. If you enter anhttp://orhttps://URL, Rostyman automatically converts it tows://orwss://. - Write a subscription query:
subscription OnOrderUpdated($orderId: ID!) {
orderUpdated(id: $orderId) {
id
status
updatedAt
items {
name
quantity
}
}
}
- Fill in variables in the Variables panel if needed
- Click Subscribe — Rostyman opens a WebSocket connection and sends the
connection_initmessage followed by your subscription
Live Events Panel
Incoming subscription events appear in real time in the events panel:
| Column | Description |
|---|---|
| Type | data, error, complete, or status |
| Timestamp | Time the event was received |
| Data | Formatted JSON payload (pretty-printed) |
- Copy button on each event copies the event data to the clipboard
- Clear button clears the event list without disconnecting
- Events auto-scroll to the bottom as they arrive
- Click Unsubscribe (or close the tab) to stop the subscription and close the WebSocket connection
Headers for Subscriptions
Headers specified in the Headers tab are passed as WebSocket connection headers, allowing authentication with Authorization: Bearer {{token}}.
Saving GraphQL Requests
GraphQL requests save to collections like any other request. All of the following are persisted:
- Body mode (
graphql) - Query text
- Variables JSON
- Selected operation name
- Schema introspection cache (per endpoint)
Tips
- Use Ctrl+Space to trigger autocomplete manually at any point in the query
- Introspect once and the schema is cached — autocomplete works offline after that
- Use the Schema Explorer to discover available fields without reading documentation
- Multiple operations in one document is useful for keeping related queries together; the operation selector lets you run whichever one you need
- Variables support
{{env_var}}syntax, so the same query can target different IDs across environments