You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello 👋
I would like to ask if it's currently possible to deprecate a member of a union similarly to deprecating a member of an enum? Suppose we have the following union:
constEvent=unionType({name: "Event",definition(t){t.members(EventA,EventB,);t.resolveType((item)=>item["__typename"]);},});constEventA=objectType({name: "EventA",deprecation: "Replaced by EventB",// this doesn't workdefinition(t){t.field("someField",{type: SomeType});},});constEventB=objectType({name: "EventB",definition(t){t.boolean("someOtherField");},});
With enums we could just do the following but not with unions as far as I know:
constMyEnum=enumType({name: "MyEnum",members: [{name: "EnumA",deprecation: "Replaced by EnumB"},"EnumB",],});
The text was updated successfully, but these errors were encountered:
It is not, but only because this is not supported by GraphQL / graphql-js. If this changes in the spec we will add this behavior to nexus, but at present it is out of scope for the library.
Hello 👋
I would like to ask if it's currently possible to deprecate a member of a
union
similarly to deprecating a member of anenum
? Suppose we have the following union:With
enum
s we could just do the following but not with unions as far as I know:The text was updated successfully, but these errors were encountered: