When you deploy a new subgraph, a public GraphQL endpoint is provided by default. However, you can also create a private endpoint for your subgraph, which requires an authentication token for requests. This private endpoint ensures that only authorized users or applications can access your subgraph’s data, maintaining data security and control.
Once enabled, your unique private GraphQL URL will be displayed. You can also find this URL listed on the main page of your project environment under the “PRIVATE GRAPHQL LINK” column.
To query your private GraphQL endpoint, you must include an authentication token in the request header.
Obtain your API key from the 0xgraph console API Keys.
In your GraphQL client (like GraphiQL or Postman), add an Authorization header.
Set the header value to Bearer YOUR_API_KEY, replacing YOUR_API_KEY with the actual key.
Here’s how it looks in the GraphiQL interface provided by 0xgraph:By following these steps, you can securely interact with your subgraph using its private GraphQL endpoint.