We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress of the issue based on the Contributor Workflow
Make sure to fork this template and run yarn generate in the terminal. Please make sure Mesh package versions under package.json matches yours.
Make sure to fork this template and run yarn generate in the terminal.
yarn generate
Please make sure Mesh package versions under package.json matches yours.
package.json
Describe the bug
Running into this issue: apollographql/apollo-client#9925 (comment)
To Reproduce Steps to reproduce the behavior:
I'm using it in next.js, don't know if that makes a difference.
Additional context
If I follow the trail of the comments of the original issue
Which led me to this PR ardatan/graphql-tools#4539
Then this comment ardatan/graphql-tools#4539 (comment)
And then ardatan/graphql-tools@ff3c071
After applying the following patch, it seems to work as expected:
diff --git a/node_modules/@graphql-mesh/apollo-link/index.mjs b/node_modules/@graphql-mesh/apollo-link/index.mjs index d1e2b34..fbf27e3 100644 --- a/node_modules/@graphql-mesh/apollo-link/index.mjs +++ b/node_modules/@graphql-mesh/apollo-link/index.mjs @@ -1,6 +1,8 @@ -import { ApolloLink, Observable } from '@apollo/client/core'; import { isAsyncIterable } from '@graphql-tools/utils'; import { getOperationAST } from 'graphql'; +import * as apolloImport from '@apollo/client'; + +const apollo = apolloImport?.default ?? apolloImport; const ROOT_VALUE = {}; function createMeshApolloRequestHandler(options) { @@ -10,7 +12,7 @@ function createMeshApolloRequestHandler(options) { throw new Error('GraphQL operation not found'); } const operationFn = operationAst.operation === 'subscription' ? options.subscribe : options.execute; - return new Observable(observer => { + return new apollo.Observable(observer => { Promise.resolve() .then(async () => { const results = await operationFn(operation.query, operation.variables, operation.getContext(), ROOT_VALUE, operation.operationName); @@ -38,7 +40,7 @@ function createMeshApolloRequestHandler(options) { }); }; } -class MeshApolloLink extends ApolloLink { +class MeshApolloLink extends apollo.ApolloLink { constructor(options) { super(createMeshApolloRequestHandler(options)); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
Running into this issue: apollographql/apollo-client#9925 (comment)
To Reproduce
Steps to reproduce the behavior:
I'm using it in next.js, don't know if that makes a difference.
Additional context
If I follow the trail of the comments of the original issue
Which led me to this PR ardatan/graphql-tools#4539
Then this comment ardatan/graphql-tools#4539 (comment)
And then ardatan/graphql-tools@ff3c071
After applying the following patch, it seems to work as expected:
The text was updated successfully, but these errors were encountered: