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'm getting a type error exactly at this point. Probably is some conflict between schema property from GraphQLServer and the type returned by mergeSchemas() from graphql-tools.
Snippet
constschemas: GraphQLSchema[]=[]constfolders=fs.readdirSync(path.join(__dirname,'./modules'))folders.forEach((folder)=>{const{ resolvers }=require(`./modules/${folder}/resolvers`)consttypeDefs=importSchema(path.join(__dirname,`./modules/${folder}/schema.graphql`))schemas.push(makeExecutableSchema({ resolvers, typeDefs }))})// GETTING ERROR ON THIS NEXT LINEconstgqlServer=newGraphQLServer({schema: mergeSchemas({ schemas })})
Stack Backtrace:
Type 'import("/gql-ts-boilerplate/node_modules/graphql/type/schema").GraphQLSchema' is not assignable to type 'import("/gql-ts-boilerplate/node_modules/apollo-link/node_modules/graphql/type/schema").GraphQLSchema'.
The types returned by 'getQueryType()' are incompatible between these types.
Type 'Maybe<GraphQLObjectType<any, any>>' is not assignable to type 'Maybe<GraphQLObjectType<any, any, { [key: string]: any; }>>'.
Type 'GraphQLObjectType<any, any>' is not assignable to type 'Maybe<GraphQLObjectType<any, any, { [key: string]: any; }>>'.
Types of property 'isTypeOf' are incompatible.
Type 'import("/gql-ts-boilerplate/node_modules/graphql/jsutils/Maybe").Maybe<import("/gql-ts-boilerplate/node_modules/graphql/type/definition").GraphQLIsTypeOfFn<any, any>>' is not assignable to type 'import("/gql-ts-boilerplate/node_modules/apollo-link/node_modules/graphql/tsutils/Maybe").default<import("/gql-ts-boilerplate/node_modules/apollo-link/node_modules/graphql/type/definition").GraphQLIsTypeOfFn<any, any>>'.
Type 'GraphQLIsTypeOfFn<any, any>' is not assignable to type 'Maybe<GraphQLIsTypeOfFn<any, any>>'.
Types of parameters 'info' and 'info' are incompatible.
Property 'cacheControl' is missing in type 'import("/gql-ts-boilerplate/node_modules/apollo-link/node_modules/graphql/type/definition").GraphQLResolveInfo' but required in type 'import("/gql-ts-boilerplate/node_modules/graphql/type/definition").GraphQLResolveInfo'.
The text was updated successfully, but these errors were encountered:
Hey Ben, thanks for the project, very helpful!
I'm getting a type error exactly at this point. Probably is some conflict between
schema
property from GraphQLServer and the type returned bymergeSchemas()
from graphql-tools.Snippet
Stack Backtrace:
The text was updated successfully, but these errors were encountered: