-
-
Notifications
You must be signed in to change notification settings - Fork 575
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
Current enum value isn't present on GraphQLEnumType_values_value scope #2035
Labels
Comments
Related: graphql/graphql-js#4018 |
Turns out |
On hold due to #2142 |
5 tasks
Something like this should work: const makeDeprecateEnumsPlugin = (enumTypeName: string, enumValues: string[], deprecationReason: string): GraphileConfig.Plugin => ({
name: `DeprecateEnumsPlugin_${enumTypeName}_${enumValues.join("_")}`,
value: "0.0.0",
schema: {
hooks: {
GraphQLEnumType_values_value(value, build, context) {
if (context.Self.name !== enumTypeName) return value;
if (!enumValues.includes(context.scope.valueName)) return value;
return {
...value,
deprecationReason,
}
}
}
}
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should be equivalent to the
fieldName
on theGraphQLObjectType_fields_field
scope.enumValueName
?Hipri: sylv
The text was updated successfully, but these errors were encountered: