Since https://github.com/graph-gophers/graphql-go/commit/498fe3961c3058c45f5ad90b1212a48adfbba266 we can add @deprecated to types like so:
type User {
name: String!
age: int @deprecated(reason: "Use `dob` instead")
dob: Date!
}
However the @deprecated directive throws an error on input:
input UserInput {
name: String!
age: int! = 0 @deprecated(reason: "Use `dob` instead")
dob: Date!
}
panic: graphql: syntax error: unexpected "@", expecting Ident
Also found that it's not supported on Field Args either, eg:
type User {
properties(
limit: int = 20 @deprecated(reason: "limit is no longer supported, always returns all")
): [Property!]!
}
panic: graphql: syntax error: unexpected "@", expecting Ident
I've started work in a new parser that should support all of these and a bunch of other new features like schema extensions. It's up to Tony if that lands here, but feel free to have a look.
Looks interesting @vektah Thanks for sharing.
gqlgen looks good too; just wondering why you created a new project, rather than contributing to this one? Would be nice to have a "de facto" GraphQL Server for Golang... much like Apollo is for Javascript.
At the time I started writing gqlgen this package was unmaintained, and I wanted to take it in a very different direction (the whole execution phase & json marshalling is generated out as go code). I can't realistically expect anyone to merge a 5k+ line PR to the core request executor.
I still think a heap of work can be shared, bringing the whole go graphql ecosystem forward, like getting a robust parser & validator out independent of the server.
This is working its way into the spec https://github.com/facebook/graphql/pull/525
Most helpful comment
At the time I started writing gqlgen this package was unmaintained, and I wanted to take it in a very different direction (the whole execution phase & json marshalling is generated out as go code). I can't realistically expect anyone to merge a 5k+ line PR to the core request executor.
I still think a heap of work can be shared, bringing the whole go graphql ecosystem forward, like getting a robust parser & validator out independent of the server.