Closed
Description
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
?
Hipri: sylv
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done
Activity