graphql
graphql copied to clipboard
Enum in Default value in query arguments
I cannot find a way to use a enum type as a default value in the arguments of a query.
@stdevHsequeda Are you trying to define something like this:
type Query {
someField(val: MyEnum = A_ENUM_VALUE): Something
}
enum MyEnum {
A_ENUM_VALUE
ANOTHER_ENUM_VALUE
}
If so, then when you define the args for someField
, you need to set DefaultValue
to A_ENUM_VALUE
in quotes.
"val": &graphql.ArgumentConfig{
Type: MyEnumType,
DefaultValue: "A_ENUM_VALUE",
}
Yes, but nothing.
@Zaba505 this does not reflect default value on GraphQL schema docs, any idea why?