Skip to content

GraphQL

GraphQL syntax differs significantly between implementations.

VS Code REST Client
POST https://api.example.com/graphql
Content-Type: application/json
X-REQUEST-TYPE: GraphQL

query ($id: ID!) {
  user(id: $id) { name email }
}

{"id": "123"}
JetBrains
GRAPHQL https://api.example.com/graphql

query ($id: ID!) {
  user(id: $id) { name email }
}

{"id": "123"}
httpyac
POST https://api.example.com/graphql
Content-Type: application/json

gql MyQuery < ./query.gql

{"variable": "value"}

Uses a POST method with a special X-REQUEST-TYPE: GraphQL header. The query is the body, separated from optional variables by a blank line:

POST https://api.example.com/graphql
Content-Type: application/json
X-REQUEST-TYPE: GraphQL
query ($id: ID!) {
user(id: $id) { name email }
}
{"id": "123"}

Uses a dedicated GRAPHQL method keyword:

GRAPHQL https://api.example.com/graphql
query ($id: ID!) {
user(id: $id) { name email }
}
{"id": "123"}

JetBrains also supports GraphQL over WebSocket (ws:// / wss:// URLs). Live template shortcut: gqlr.

Automatically detects GraphQL queries in POST bodies (no special header required). Supports GraphQL fragments and importing queries from .gql files:

POST https://api.example.com/graphql
Content-Type: application/json
gql MyQuery < ./query.gql
{"variable": "value"}

httpyac auto-generates the proper {"query": "...", "variables": {...}} JSON envelope.

Supports GraphQL through the GRAPHQL keyword (JetBrains-compatible).

Does not support GraphQL.

Feature VS CodeJetBrainshttpyacVS 2022kulala
GraphQL via X-REQUEST-TYPE header
GraphQL via GRAPHQL keyword
GraphQL auto-detection
WebSocket JetBrains: WEBSOCKET keyword. httpyac: WS/WSS keyword.
gRPC httpyac supports all four RPC types.
Server-Sent Events JetBrains: via script processing. httpyac: SSE/EVENTSOURCE keyword.
MQTT Unique to httpyac.
AMQP/RabbitMQ Unique to httpyac.