Question
How to correctly declare a GraphQL query without parameters.
I'm using vs code + graphql-cli for validating & linting the schema. In the following declaration (in the graphql schema file):
type Query {
users(): Int
}
The users
declaration above is marked as en error, but it doesn't make any problem (or warning) by the server - it's only vs code and graphql lint
reporting it as an error:
2:9 Syntax Error: Expected Name, found ) undefined
If I add a parameter to the query, eg:
type Query {
users(n: Int): Int
}
then there is no problem reported by vs code or graphql-cli. How can I properly declare a graphql query without parameters.