-
-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An enum type that uses a custom value in mergeSchemas reports an error #1033
Comments
Same issue as mine #1035. Because of the delegating resolvers here https://github.com/apollographql/graphql-tools/blob/master/src/stitching/mergeSchemas.ts#L446. It works with your resolvers like this: const resolvers = {
// AllowedColor: {
// RED: '#f00',
// GREEN: '#0f0',
// BLUE: '#00f'
// },
Query: {
favoriteColor: () => 'RED',
avatar: (parent, args) => {
return `${JSON.stringify(args)}`
}
}
} That said, we should not have to think about that, it should behave the same. EDIT: I reproduced it here https://github.com/kommander/graphql-tool-repro/tree/allowed-color |
@kommander Thanks for your reply, all my backends expect to work with me using thrift RPC. The enum value of thrift RPC is INT, and unless mergeSchemas solves this problem, I have to give up this way. |
Does this remain an issue? I seem to be encountering the same thing trying to stitch together a local and remote schema. The local is created from 19majkel94/type-graphql which uses the resolver method to allow internal enum values. This seems like a pretty major nuisance. Does anyone have a way around this? |
Ran into this too problem too, definitely remains an issue. So basically you cannot merge schemas if they use enums? |
I think @stefanprobst has fixed this in #1075. |
Rolled into #1306 |
It works when I use
makeExecutableSchema
, but I usemergeSchemas
to report an error.The text was updated successfully, but these errors were encountered: