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
I am unable to correctly type the context in the following code:
const graphqlSchema = createSchema({ typeDefs, resolvers })
interface GraphQLContext extends YogaInitialContext {
something: number
}
const yoga = createYoga<GraphQLContext>({
schema: graphqlSchema,
context: {
something: 10
}
});
const server = createServer<(yoga)
server.listen(port, () => {
console.log(`[server]: Server is running at http://localhost:${port}`);
});
I get the following Typescript Error. Even if I do or do not pass the custom GraphQLContext generic.
Type 'GraphQLResolveInfo & YogaInitialContext' is not assignable to type 'YogaInitialContext & { something: number; }'.
Property 'something' is missing in type 'GraphQLResolveInfo & YogaInitialContext' but required in type '{ something: number; }'.ts(2322)
Describe the bug
I am unable to correctly type the context in the following code:
I get the following Typescript Error. Even if I do or do not pass the custom
GraphQLContext
generic.Your Example Website or App
https://github.com/chalupagrande/yoga-graphql-server
Steps to Reproduce the Bug or Issue
src/server.ts
Potentially related issue:
issue1
yoga
to an Express Router intanceExpected behavior
Screenshots or Videos
Platform
@graphql-yoga/*
version(s): "^5.12.0"Additional context
No response
The text was updated successfully, but these errors were encountered: