Closed timscott closed 4 years ago
I figured it out. Leaving here for posterity.
# MyEnum.graphql
enum MyEnum {
A
B
C
}
// resolver.js
export const resolver = {
MyEnum: {
A: 1,
B: 2
C: 3
}
};
Now if you resolve a field of type MyEnum
with an integer value (e.g. 2) it will resolve to the enum (e.g. B).
I would like to take advantage of
graphql-js
ability to map integer values to enums be defining it in JS usingGraphQLEnumType
. Is this possible when using schemaglue?