graph-client icon indicating copy to clipboard operation
graph-client copied to clipboard

Allow Specifying Data Source for Query

Open frankfka opened this issue 2 years ago • 4 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 avatar Nov 25 '22 18:11 frankfka

@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 avatar Dec 05 '22 08:12 matthewlilley

@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

frankfka avatar Dec 05 '22 18:12 frankfka

@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

matthewlilley avatar Dec 06 '22 09:12 matthewlilley

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?

dhruv035 avatar Jul 13 '23 13:07 dhruv035