Open basicdays opened 3 years ago
This is a high value bug that I've seen symptoms of over the years.
My team hasn't been using a hybrid environment yet -- only apollo-link-state and apollo-link-rest so far -- but we're hoping to get to it in January.
Do you think you might be interested in helping fix this issue? Hybrid queries are definitely intended to be supported.
I can see if I can look into this one a bit. I get the feeling this specific one may be a bit complex under the hood. Will likely have a series of questions about it when I get into it, ha.
We have both graphQl and REST endpoint in our project and I am able to use achieve this using apollo-link-rest library. Basically you need to route your requests based on some context and can split them in httplink depending on that context.
This is a high value bug that I've seen symptoms of over the years.
My team hasn't been using a hybrid environment yet -- only apollo-link-state and apollo-link-rest so far -- but we're hoping to get to it in January.
Do you think you might be interested in helping fix this issue? Hybrid queries are definitely intended to be supported.
We have both graphQl and REST endpoint in our project and I am able to use achieve this using apollo-link-rest library. Basically you need to route your requests based on some context and can split them in httplink depending on that context. Not sure your use case is same or different.
While this does have a workaround (mentioned by @vaibhavcpgeek), I am interested in seeing improvements to the library around this. I do agree it's likely to be a bit complex however!
Hello all 👋
Currently trying out a hybrid approach against Github's APIs using both their GraphQL and Rest APIs. Attempted to put together a test query to see if I can get this thing working before I start adopting it and ran into an issue in regards to querying both their graphql and rest queries at once. I'm just currently executing this via a Node script.
The following query will result in the error
ApolloError: Variable $repositoryPage is declared by Viewer but not used
:If I instead query
viewer
andrestViewer
fields in separate GraphQL queries, then this error does not occur. I would expect that the act of including a top level GraphQL field would not cause variables only used within rest fields to error out.For reference, here is the client configuration:
For the sake of easily replicating this, I've added a repository that reproduces this: https://github.com/basicdays/ghtest
Notes:
nested
endpoint is a hack to get around issue #192Headers
is an issue in #279