Skip to main content

What is a private GraphQL URL?

By default, every deployed subgraph includes a public GraphQL endpoint. You can also enable a private endpoint, which requires an authentication token for every request.

Private endpoints are ideal for:

  • Restrict data access to trusted users or applications.
  • Protect sensitive onchain data in production.
  • Manage usage via authenticated API keys.

Step 1: Navigate to the 0xGraph console and press the >_ icon

0xGraph graph init

Step 2: Click on the “Tags” tab

0xGraph graph init
Tick the Enabled checkbox

Find your private URL

0xGraph graph init
Once enabled, your unique private GraphQL URL can be accesed from the 0xGraph console.

Authenticate your requests

Private endpoints require an API key in the request header for authentication.

Step 1: Generate an API key.

0xGraph graph init

Step 2: Add the API key into the Authorization header in the GraphQL client.

{ "Authorization": "Bearer GVOQH8CE7XL0WTOXXXXXXXXXX" }
Set the header value to Bearer GVOQH8CE7XL0WTOXXXXXXXXXX, replacing GVOQH8CE7XL0WTOXXXXXXXXXX with the API key you just generated.
0xGraph graph init
By following these steps, you can securely interact with your subgraph using its private GraphQL endpoint.
I