graphql-go / graphql-go/graphql

Why DeprecationReason is an empty string in introspection

Open
#713 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

I noticed that `codegen`, very popular tool to generate types from a schema, marks as `deprecated` all the possible types, queries, and mutations.
After some debugging I found out that the `deprecationReason` is returned by the introspection as an **empty string**.
For some reasons, `codegen` gives more importance to it than `isDeprecated` field (which is correctly set to `false`).
I checked around and I saw an old MR of @MarkKremer that fixed this problem.
But looking at the code now, it looks like that change has been reverted.
Any explanation for it?
I still think it makes sense to have the reason set to `nil` rather than an empty string.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.