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

Directive deprecated is not applicable on INPUT_FIELD_DEFINITION #1579

Closed
vikusku opened this issue Aug 3, 2021 · 1 comment
Closed

Directive deprecated is not applicable on INPUT_FIELD_DEFINITION #1579

vikusku opened this issue Aug 3, 2021 · 1 comment

Comments

@vikusku
Copy link

vikusku commented Aug 3, 2021

Hi,

The title is pretty much self explanatory. When trying to generate code from schema that had @deprecated directive on the input fields I get this error. Is it a bug or expected behaviour? If it's not a bug what is the reason behind dropping @deprecated directive support on INPUT_FIELD_DEFINITION?

Minimal graphql.schema and models to reproduce

schema {
    query: Query
}

type Query {
   getMenu(input: GetMenuInput!): Menu!
}

input GetMenuInput {
    menuID: ID @deprecated(reason: "Use `id`")
    id: ID
}

type Menu {
    id: ID!
    name: String!
}

versions

  • gqlgen version - v.0.12.*
  • go version - go1.16.6
  • go modules
@milesich
Copy link

milesich commented Aug 7, 2021

This library supports only FIELD_DEFINITION and ENUM_VALUE based on this declaration:

directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ENUM_VALUE

There is a PR to change it.

@lwc lwc closed this as completed Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants