GraphQL Requests
Vegha has a dedicated GraphQL request mode with a split editor for your operation and its variables, plus schema introspection.
Creating a GraphQL request
Section titled “Creating a GraphQL request”Create a request and set its body type to GraphQL. The Body tab then shows two panes:
- Query — your GraphQL query, mutation, or subscription document.
- Variables — a JSON object supplying values for the operation’s variables.
query GetUser($id: ID!) { user(id: $id) { id name email }}{ "id": "42"}How it maps to HTTP
Section titled “How it maps to HTTP”A GraphQL request is sent as an HTTP POST. Vegha builds a JSON body containing your query string and variables object and posts it to the endpoint in the URL bar. Because it is an HTTP request underneath, everything from the HTTP workflow still applies:
- Set the endpoint in the URL bar.
- Add headers on the Headers tab — for example an
Authorizationheader. - Choose an auth method on the Authorization tab.
- Use
{{variable}}interpolation in the URL, headers, query, and variables.
Send with Ctrl+Enter (⌘+Enter on macOS).
Schema introspection
Section titled “Schema introspection”Vegha can introspect the server’s GraphQL schema by sending a standard introspection query to the endpoint. Once the schema is loaded, it powers awareness of the available types, fields, and operations while you write your query.
Variables
Section titled “Variables”You can combine GraphQL operation variables with Vegha’s {{variable}} interpolation. The Variables pane holds GraphQL variables passed to the server, while {{variable}} placeholders are resolved by Vegha from the collection, environment, and workspace scopes before the request is sent. Both can appear in the same request — for example, interpolate {{userId}} into the Variables JSON.
Inspecting the response
Section titled “Inspecting the response”The response is shown in the standard response viewer with JSON formatting and syntax highlighting, including any data and errors fields the server returns. See Responses for the full response viewer reference.