Skip to content

Throw a warning when we are using a deprecated field #374

@Kocal

Description

@Kocal

Hey,

I'm currently writing some docs on field deprecation (because I always forgot how to do it 🤣 ) and I just encountered a weird behavior.

When we mark a field a field as deprecated and we still use it in queries, it would be nice to see a warning, no?

Human:
    type: object
    config:
        description: 
        fields:
            faith:
                deprecationReason: "We've lost faith in Humanity"

Query:
    type: object
    config:
         fields:
             humans: { type: "[Human]!" }

running query { humans { faith } } should returns something like that:

{
  "data": {
    "humans": [...]
  },
  "extension": {
    "deprecationWarnings": [
      {
        "message": "The field is marked as deprecated",
        "field": "humans.faith",
        "reason": "We've lost faith in Humanity"
      }
    ]
  }
}

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions