Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@deprecated directive on input #204

Closed
rogchap opened this issue May 8, 2018 · 5 comments · Fixed by #541
Closed

@deprecated directive on input #204

rogchap opened this issue May 8, 2018 · 5 comments · Fixed by #541

Comments

@rogchap
Copy link

rogchap commented May 8, 2018

Since 498fe39 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
@rogchap
Copy link
Author

rogchap commented May 10, 2018

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

@vektah
Copy link

vektah commented May 10, 2018

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.

https://github.com/vektah/gqlparser

@rogchap
Copy link
Author

rogchap commented May 10, 2018

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.

@vektah
Copy link

vektah commented May 10, 2018

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.

@smitt04
Copy link

smitt04 commented Oct 25, 2018

This is working its way into the spec graphql/graphql-spec#525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants