Reputation: 2347
What is the graphql syntax in SDL to use an enum as a query argument?
schema {
query: Query
}
type Query {
getWordsCountByLanguage (language: LanguageIso): [WordCount]
}
enum LanguageIso {
AA
AB
}
Parsing the above schema will throw an error that Expected type 'language' to be a GraphQLInputType, but it wasn't!
Defining an input type that includes an enum will result on a similar error.
It looks like there is no way of using an enum as a query argument in SDL.
Upvotes: 2
Views: 2535