I am using the [graphql][1]
gem to build out a GraphQL API.
When defining inputs for example --
Inputs::BranchInput = GraphQL::InputObjectType.define do
name 'BranchInput'
argument :scope, types.String
end
The argument scope
is actually an enum field that will accept either small
or big
. How can I define this in the input that this argument will only accept these two values? Is it possible to show this in the docs as well when they are generated so that the UI developers are also clear on this?
When using Grape to generate REST APIs, I would generally use to values
parameter to define something like this.