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
Hello Everyone,
I have a pretty large project that I'm trying to move to graphql using fastify, mercurius, mercurius-codegen and mercurius-integration-testing
I've split my business logic into modules, so the code is structured like this
Argument of type 'IResolvers<any, MercuriusContext>[]' is not assignable to parameter of type 'IResolvers<any, MercuriusContext, Record<string, any>, any> | Maybe<IResolvers<any, MercuriusContext, Record<string, any>, any>>[] | null | undefined'.
Type 'IResolvers<any, MercuriusContext>[]' is not assignable to type 'Maybe<IResolvers<any, MercuriusContext, Record<string, any>, any>>[]'.
Type 'IResolvers<any, MercuriusContext>' is not assignable to type 'Maybe<IResolvers<any, MercuriusContext, Record<string, any>, any>>'.
'string' index signatures are incompatible.
Type 'GraphQLScalarType<unknown, unknown> | IEnumResolver | (() => any) | IResolverObject<any, MercuriusContext, any> | IResolverOptions<...> | undefined' is not assignable to type 'IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver | ISchemaLevelResolver<...> | IObjectTypeResolver<...> | IInterfaceTypeResolver<...>'.
Type 'undefined' is not assignable to type 'IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver | ISchemaLevelResolver<...> | IObjectTypeResolver<...> | IInterfaceTypeResolver<...>'.ts(2345)
Any help?
The text was updated successfully, but these errors were encountered:
I understand your confusion, because of the naming clash, but when I'm importing, resolvers refers to the file name as stated on the structure of the project. I'm not referencing the const resolvers: IResolvers ... (which isn't exported btw).
Hello Everyone,
I have a pretty large project that I'm trying to move to graphql using fastify, mercurius, mercurius-codegen and mercurius-integration-testing
I've split my business logic into modules, so the code is structured like this
base.ts
contains the root query and mutation, in order to let other schema.ts files to extendA schema file contains something like this
Here's a resolver:
In order to avoid bloating the server.ts file, I've created an application.ts to import all the schemas and resolvers
The problem arises when I need to set up mercurius:
With resolvers merged with the spread operator, all are overwritten by the last one.
Using
mergeResolvers
from graphql-tools create a different problemgive me this error
Any help?
The text was updated successfully, but these errors were encountered: