Private Graphql URL

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.

To use the private endpoint, you first need to enable it in your subgraph’s detail on the 0xgraph console.

  1. Navigate to your project details page.
  2. Find the “PRIVATE GRAPHQL LINK” section.
  3. Toggle the switch to “Enabled”.

Find Your Private URL

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.

Authentication

To query your private GraphQL endpoint, you must include an authentication token in the request header.

  1. Obtain your API key from the 0xgraph console API Keys.
  2. In your GraphQL client (like GraphiQL or Postman), add an Authorization header.
  3. 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.