Subgraph Configuration

Define settings per subgraph to add to or override global settings.

[subgraphs.products] url = "https://example.com/graphql" websocket_url = "https://example.com/" timeout = "4s"
  • url: Set the GraphQL endpoint for the subgraph to override the schema endpoint.
  • websocket_url: Specifies the WebSocket URL that a subgraph uses when it differs from the GraphQL endpoint.
  • timeout: The timeout for the subgraph.

Configure different settings per subgraph:

[subgraphs.products.entity_caching] enabled = true ttl = "60s"
  • enabled: Enables or disables entity caching for the subgraph. Default value is the global setting.
  • ttl: Sets the time-to-live for the cache. Default value is the global setting.

Read more on global entity cache.

Define header rules per subgraph. They execute after the global rules.

[[subgraphs.products.headers]] rule = "forward" name = "content-type"

For more information about available options, see global header rules.

Define custom rate limits for each subgraph and let the gateway check them before it sends requests. For more information, see rate limiting. You can hot-reload the subgraph rate limit and duration settings.

[subgraphs.products.rate_limit] limit = 100 duration = "10s"

For more information about available options, see global rate limit configuration.

You can override the retry budget for the specific subgraph.

[subgraphs.products.retry] enabled = true min_per_second = 10 ttl = "1s" retry_percent = 0.1 retry_mutations = false

For more information about available options, see global retries configuration.