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
Get incompatible error when using custom context type because the ApolloServer is not a generic.
Here is the example:
interfaceContext{foo: string}constformatResponse: GraphQLOptions<Context>['formatResponse']=(response)=>response//<-- 1. error: null is not assignable to 'GraphQLResponse'constserver=newApolloServer({
formatResponse,//<-- 2. error: Property 'foo' is missing in type '{}' but required in type 'Context'})
The text was updated successfully, but these errors were encountered:
As @Markus-ipse says, the first concern was fixed earlier this year (#5089, v2.23.0).
If the second concern is still an issue, please file a new issue including a full reproduction (eg starting with git clone or using codesandbox.io) demonstrating it.
Currently, I encountered some type errors with
apollo-server
package.For the
formatResponse
typeDefine,response
can be null, but the returned type doesn't acceptnull
apollo-server/packages/apollo-server-core/src/graphqlOptions.ts
Lines 48 to 51 in 8059326
Get incompatible error when using custom context type because the
ApolloServer
is not a generic.Here is the example:
The text was updated successfully, but these errors were encountered: