Skip to content
New issue

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

@graphql-hive/client throws TypeError #2816

Open
shobhitsharma opened this issue Sep 14, 2023 · 6 comments
Open

@graphql-hive/client throws TypeError #2816

shobhitsharma opened this issue Sep 14, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@shobhitsharma
Copy link

Stacktrace

Failed to collect operation TypeError: Cannot read properties of undefined (reading 'definitions')
    at complete (/node_modules/.pnpm/@graphql-hive+client@0.24.1_graphql@16.6.0/node_modules/@graphql-hive/client/cjs/internal/usage.js:104:57)
    at Object.willSendResponse (/node_modules/.pnpm/@graphql-hive+client@0.24.1_graphql@16.6.0/node_modules/@graphql-hive/client/cjs/apollo.js:155:25)
    at /node_modules/.pnpm/@apollo+server@4.9.3_graphql@16.6.0/node_modules/@apollo/server/dist/cjs/requestPipeline.js:274:75
    at Array.map (<anonymous>)
    at invokeWillSendResponse (/node_modules/.pnpm/@apollo+server@4.9.3_graphql@16.6.0/node_modules/@apollo/server/dist/cjs/requestPipeline.js:274:44)
    at sendErrorResponse (/node_modules/.pnpm/@apollo+server@4.9.3_graphql@16.6.0/node_modules/@apollo/server/dist/cjs/requestPipeline.js:293:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async processGraphQLRequest (/node_modules/.pnpm/@apollo+server@4.9.3_graphql@16.6.0/node_modules/@apollo/server/dist/cjs/requestPipeline.js:51:24)
    at async internalExecuteOperation (/node_modules/.pnpm/@apollo+server@4.9.3_graphql@16.6.0/node_modules/@apollo/server/dist/cjs/ApolloServer.js:634:16)
@dotansimha
Copy link
Collaborator

Thanks @shobhitsharma , can you please share more details? what version of this package are you using? and what GraphQL server + NodeJS version are you running?

@kamilkisiela
Copy link
Collaborator

"@apollo/server": "4.9.3"
"@graphql-hive/client": "0.24.1"
"graphql": "16.6.0"

@kamilkisiela
Copy link
Collaborator

I can't reproduce it :(

@kamilkisiela
Copy link
Collaborator

Can you try 0.24.2-alpha-20230928151650-fb1f0fa0? In #2979 I added a log message with an operation name when a DocumetNode is not available. It should help us narrow down the issue to a specific GraphQL operation.

@imdadul
Copy link

imdadul commented Oct 5, 2023

Can you try 0.24.2-alpha-20230928151650-fb1f0fa0? In #2979 I added a log message with an operation name when a DocumetNode is not available. It should help us narrow down the issue to a specific GraphQL operation.

Failed to collect operation TypeError: Cannot read properties of undefined (reading 'name')
    at Object.Field (/node_modules/.pnpm/@graphql-hive+client@0.24.2-alpha-20230928151650-fb1f0fa0_graphql@16.6.0/node_modules/@graphql-hive/client/cjs/internal/usage.js:253:54)
    at Object.enter (/node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/utilities/TypeInfo.js:391:27)
    at visit (/node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/visitor.js:197:21)
    at collect (/node_modules/.pnpm/@graphql-hive+client@0.24.2-alpha-20230928151650-fb1f0fa0_graphql@16.6.0/node_modules/@graphql-hive/client/cjs/internal/usage.js:249:29)
    at /node_modules/.pnpm/@graphql-hive+client@0.24.2-alpha-20230928151650-fb1f0fa0_graphql@16.6.0/node_modules/@graphql-hive/client/cjs/internal/utils.js:38:23
    at complete (/node_modules/.pnpm/@graphql-hive+client@0.24.2-alpha-20230928151650-fb1f0fa0_graphql@16.6.0/node_modules/@graphql-hive/client/cjs/internal/usage.js:122:54)
    at Object.willSendResponse (/node_modules/.pnpm/@graphql-hive+client@0.24.2-alpha-20230928151650-fb1f0fa0_graphql@16.6.0/node_modules/@graphql-hive/client/cjs/apollo.js:171:25)
    at /node_modules/.pnpm/@apollo+server@4.9.3_graphql@16.6.0/node_modules/@apollo/server/dist/cjs/requestPipeline.js:274:75
    at Array.map (<anonymous>)
    at invokeWillSendResponse (/node_modules/.pnpm/@apollo+server@4.9.3_graphql@16.6.0/node_modules/@apollo/server/dist/cjs/requestPipeline.js:274:44)"

@kamilkisiela
Copy link
Collaborator

@imdadul hmm to me it seems like GraphQLSchema is not in sync with GraphQL operation.

Can you try 0.24.3-alpha-20231005085447-ceb7a201? It should display operation's name and a location of the error (path to a field).
Will you be able to create a reproduction?

@n1ru4l n1ru4l added the bug Something isn't working label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants