Skip to content

The deprecated reson is NOT updated using the SchemaTransformer #3786

@t2gran

Description

@t2gran

Describe the bug

When using the SchemaTransformer.transformSchema(...) to inject custom API documentation the transformation fails to inject a deprecated reason if it already exist. Injecting deprecated reason on none deprecated fields work as expected. Injecting description on type and field also works as expected.

This bug also apply to input and interface types, as well as object types.

We would like to use this in OpenTripPlanner to customize deployments.

To Reproduce
This test below illustrate the problem. Everything works as expected for field a, but the reason is not updated for field b.

Original Schema

type QueryType {
  a: String
  b: String @deprecated(reason : "Replace this doc")
}

Expected result

type QueryType {
  a: String @deprecated(reason : "NEW REASON")
  b: String @deprecated(reason : "NEW REASON")
}

Actual result

type QueryType {
  a: String @deprecated(reason : "NEW REASON")
  b: String @deprecated(reason : "Replace this doc")
}

JUnit Test

https://gist.github.com/t2gran/69b149357477870ba25e00375a2626a2

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