graphprotocol / graph-client

The Graph library for building GraphQL-based dapps in a decentralized way.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow Specifying Data Source for Query

frankfka opened this issue · comments

Hello!

Is it possible to specify the particular data source to query for a given query? I have two graphs with identical schemas. However, for a certain query, I would like to make sure that I'm hitting one particular endpoint.

I assume that this can be done with composition - but can't find an example for doing so.

And in general, is there a good resource to see how to write the .yml file?

@frankfka you might find something useful within our graph client package here:

https://github.com/sushiswap/sushiswap/blob/master/packages/graph-client/__tests__/pairs.test.ts

We do a lot of multichain queries, and chain specific queries for the same graphs.

@matthewlilley Thanks! Is there a good way to find docs for the yaml file, so that we can actually understand what the configuration does? For example, I couldn't find good documentation for addSourceName: https://github.com/sushiswap/sushiswap/blob/master/packages/graph-client/.graphclientrc.yml#L96

@matthewlilley Thanks! Is there a good way to find docs for the yaml file, so that we can actually understand what the configuration does? For example, I couldn't find good documentation for addSourceName: https://github.com/sushiswap/sushiswap/blob/master/packages/graph-client/.graphclientrc.yml#L96

For graph client specific packages, probably best to just look at the packages within this repo, the config itself is a graphql mesh config.

https://github.com/Urigo/graphql-mesh/blob/master/packages/types/src/config.ts

I cant find this option either, I would like a query to run only against 1 of the sources in the .yaml file, is there a way to do that with graphclient?