Skip to Content

Subgraph

POST /api/v1/subgraph

GraphQL relay to the ENS subgraph. Forwards raw GraphQL queries to the private ENSNode instance and returns the response. This is a pass-through proxy — the response format is determined by The Graph, not by the Grails API envelope.

Authentication: None

Cache: None

Request Body

A standard GraphQL query object:

{ "query": "query { domains(where: { name: \"example.eth\" }) { id name labelhash } }", "variables": {} }

Sample Request

curl -X POST -H "Content-Type: application/json" \ https://api.grails.app/api/v1/subgraph \ -d '{ "query": "query GetDomain($name: String!) { domains(where: { name: $name }) { id name labelhash registrant { id } registration { expiryDate } } }", "variables": { "name": "example.eth" } }'

Response

The response is proxied directly from The Graph with no wrapping:

{ "data": { "domains": [ { "id": "0x...", "name": "example.eth", "labelhash": "0x...", "registrant": { "id": "0x1234..." }, "registration": { "expiryDate": "1735689600" } } ] } }

Error Responses

StatusCodeDescription
400INVALID_REQUESTBody must be a valid GraphQL query object
502BAD_GATEWAYFailed to relay request to ENS subgraph
503SERVICE_UNAVAILABLESubgraph relay not configured
Last updated on