Skip to content

Merging of @deprecated directives #203

Description

@tobias-tengler

The merging of @deprecated directives feels to me like a different concern from merging user-defined type system directives, so I'm opening this issue to discuss possible approaches.

IMO a field in the composite schema should only be marked as @deprecated if it has been marked as such in each source schema.

Therefore I'd propose to update MergeOutputFields, MergeInputFields, MergeArguments and MergeEnumValues to something like this:

- Let {firstField} be the first field in {fields}.
...
- Let {fieldDeprecationReason} be the deprecation reason of {firstField}.
- For each {field} in {fields}:
  ...
  - Let {deprecationReason} be the deprecation reason of {field}.
  - If {deprecationReason} is {null}:
    - Let {fieldDeprecationReason} be null

My reasoning behind this change is that if a team marks a field as @deprecated in their schema, it either ends up as @deprecated in the composite schema right away, or if not, it's a signal that they have to talk to the other team(s) contributing that field.
In that case they can decide with the other team(s) to also mark their version of the field as @deprecated for a user-facing phase-out, or if the field should just be phased out from their schema, the other team(s) can utilize @override to steer the traffic away from their source schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions