graph-gophers / graphql-go

GraphQL server with a focus on ease of use
BSD 2-Clause "Simplified" License
4.65k stars 492 forks source link

Allow field names starting with a leading `_` #593

Closed pavelnikolov closed 1 year ago

pavelnikolov commented 1 year ago

The 2021 GraphQL spec allows (field) names starting with a leading _. However, in this library it is not possible to have a resolver field/method in Go starting with a leading _ because it would be private and therefore not visible from other packages.

Done when:


type Query {
    _hello: String!
}

is supported and the library can resolve a query like this:

query {
   _hello
}