Reputation: 2736
In typescript I can write:
type T = 'some words' | 'some other words' | ...
Is it possible to define such a type in GraphQL schema?
I have a downstream service that returns a set of values, some containing blanks and I would like to have a type restricted to only those values.
Upvotes: 1
Views: 602
Reputation: 20227
You can define a custom scalar that only allows your set of values.
In the absence of spaces you could also use an enum.
Upvotes: 1