Skip to content

GraphQL Query Builder

Build a GraphQL query or mutation from an operation name, dot-notation field paths and typed variables, with nested selections written for you.

GraphQL Query Builder

Output

Working…

Updated . Provided as is. Check the output before you rely on it in production.

How to use GraphQL Query Builder

  1. 1

    Choose query or mutation

    Pick whether you are building a query or a mutation.

  2. 2

    Name the operation

    Enter an operation name such as GetUser.

  3. 3

    List the fields

    Enter fields in dot notation, one per line, for example user.profile.avatarUrl; they are nested into a selection set.

  4. 4

    Declare variables

    Add variables as name: Type, for example id: ID!, then copy the generated operation.

Questions and answers

Does it validate against my schema?
No. It builds the operation text; use GraphQL Schema Viewer to explore types, or your server's tooling to validate.
How are nested fields written?
With dots: user.profile.avatarUrl becomes a nested profile { avatarUrl } selection inside user.

Use it as an API

GraphQL Query Builder is also callable as a free HTTP JSON API at https://aidevhub.io/api/graphql-query-builder/ — GET with query parameters or POST with a JSON body, no authentication, CORS enabled, fair use (abusive traffic is throttled at the edge; there is no per-request quota header). Responses return { ok, tool, result, meta }.

curl -s -X POST https://aidevhub.io/api/graphql-query-builder/ \
  -H "Content-Type: application/json" \
  -d '{"operation":"GetUser","fields":"user.id\nuser.name","variables":"id: ID!","mode":"query"}'

Machine-readable contract: /api/tool/graphql-query-builder.json All API endpoints: /agents/ LLM site index: /llms.txt

For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Dedicated API endpoint

Deterministic outputs, machine-safe contracts, and production-ready examples.

Dedicated API

https://aidevhub.io/api/graphql-query-builder/

OpenAPI: https://aidevhub.io/api/openapi.yaml

GET /api/graphql-query-builder/ GET graphql-query-builder
POST /api/graphql-query-builder/ POST graphql-query-builder

Unified Runtime API

https://aidevhub.io/api/tools/run/?toolId=graphql-query-builder&a=GetUser

GET and POST are supported at /api/tools/run/ with identical validation and limits.

Limit: 30 req / 60s, input max 256 KB.