Does GraphQL provide an alternative to enum fields like bit fields?

Creating a schema that reflects the status of the element, often leads to the introduction of these attributes, such as { new

, opened

, resolved

, closed

}. Problems arise when a new status is introduced (for example rejected

) because clients don't know how to interpret it. We are considering using a number of boolean fields, so we don't need to introduce a new enum field with a different range of values ​​when such changes occur. In this case, the rejected status will be presented as

{
  closed: true,
  rejected: true
}

      

Is this the preferred enumeration? Is it preferable to define enums with a name that indicates their range, for example statusIncludingRejected

? Is there any other pattern I should find out?

0
graphql


source to share


No one has answered this question yet

See similar questions:

3
Is adding an Enum value a change for GraphQL?

or similar:

25
What's the point of viewer field in GraphQL?
13
Are there alternative libraries for Relay and GraphQL?
6
Graphql Multiple enums per request
3
Does GraphQL Int as an enum
2
graphql: sort by nested field
1
Field-based graphics resolution
1
GraphQL - fetching a field conditionally
1
Best way to query server-side fields in GraphQL
0
Get all fields using Graphql
0
Enum for number in GraphQL (js)



All Articles
Loading...
X
Show
Funny
Dev
Pics