We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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.OH_NO_THIS_DOESNT_EXIST_YET)) return value; return { ...value, deprecationReason, } } } } });
Should be equivalent to the fieldName on the GraphQLObjectType_fields_field scope. enumValueName?
fieldName
GraphQLObjectType_fields_field
enumValueName
Hipri: sylv
The text was updated successfully, but these errors were encountered:
Related: graphql/graphql-js#4018
Sorry, something went wrong.
Turns out Self also doesn't exist; and both are for the reason outlined in the graphql-js issue above.
Self
On hold due to #2142
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, } } } } });
Successfully merging a pull request may close this issue.
Should be equivalent to the
fieldName
on theGraphQLObjectType_fields_field
scope.enumValueName
?Hipri: sylv
The text was updated successfully, but these errors were encountered: