Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Networks — Subgraph endpoints · Boson Protocol
Skip to content

Subgraph endpoints

Each chain × env has its own subgraph hosted on The Graph (or a self-hosted equivalent). The SDK and MCP both read from these.

At runtime

import { getConfigFromConfigId } from "@bosonprotocol/common"
const config = getConfigFromConfigId("production-137-0")
console.log(config.subgraphUrl)

Direct GraphQL access

You can query the subgraph directly with any GraphQL client:

import { request, gql } from "graphql-request"
 
const data = await request(
  config.subgraphUrl,
  gql`{ offers(first: 10, where: { voided: false }) { id, price, exchangeToken } }`,
)

Health-check

{
  _meta {
    block { number }
    hasIndexingErrors
  }
}

Treat the subgraph as degraded if _meta.block.number is more than ~20 behind chain head, or if hasIndexingErrors == true.

Related