You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug
I am using Apollo Server with expressMiddleware in combined with Type GraphQL. Following issue is happening in my environment.
I have tried following versions of graphql npm package resulting the same behavior:
15.8.0
15.7.0
15.7.2
Seems like a bug in graphql package and resolved in later versions.
TypeGraphQL is not allowing me to use this version of graphql package: 16.6.0
To Reproduce
Any query with Apollo Server 4 returns following error message:
TypeError: graphqlError.toJSON is not a function at enrichError (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/errorNormalize.ts:84:30) at file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/errorNormalize.ts:46:18 at Array.map (<anonymous>) at normalizeAndFormatErrors (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/errorNormalize.ts:39:29) at ApolloServer.errorResponse (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/ApolloServer.ts:1067:49) at ApolloServer.executeHTTPGraphQLRequest (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/ApolloServer.ts:1059:19) Unexpected error processing request: TypeError: graphqlError.toJSON is not a function
Expected Behavior
Queries should return the json data from resolvers.
Environment (please complete the following information):
OS: Windows 11
Node: v18.12.1
Package version: 1.1.1
TypeScript version: 4.9.3
The text was updated successfully, but these errors were encountered:
Apollo Server V4.0 has "Dropped support for versions of the graphql library prior to v16.6.0".
You need to use previous version or install type-graphql@2.0.0-beta.1.
I resolved my issue by upgrading type-graphql package to ^2.0.0-beta.1. Both Apollo Server and Type GraphQL are working fine now with higher versions of graphql package.
Describe the Bug
I am using Apollo Server with expressMiddleware in combined with Type GraphQL. Following issue is happening in my environment.
I have tried following versions of graphql npm package resulting the same behavior:
Seems like a bug in graphql package and resolved in later versions.
TypeGraphQL is not allowing me to use this version of graphql package: 16.6.0
To Reproduce
Any query with Apollo Server 4 returns following error message:
TypeError: graphqlError.toJSON is not a function at enrichError (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/errorNormalize.ts:84:30) at file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/errorNormalize.ts:46:18 at Array.map (<anonymous>) at normalizeAndFormatErrors (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/errorNormalize.ts:39:29) at ApolloServer.errorResponse (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/ApolloServer.ts:1067:49) at ApolloServer.executeHTTPGraphQLRequest (file:///C:/Sources/seat-graph/node_modules/@apollo/server/src/ApolloServer.ts:1059:19) Unexpected error processing request: TypeError: graphqlError.toJSON is not a function
Expected Behavior
Queries should return the json data from resolvers.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: