Skip to content

Commit

Permalink
fix: use "No longer supported" as the default deprecationReason for d…
Browse files Browse the repository at this point in the history
…eprecated fields with no reason specified
  • Loading branch information
arseniocosta1 committed Jun 23, 2023
1 parent 5ac9fe5 commit 74ec050
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions graphql/introspection/introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,17 @@ func (f *Field) DeprecationReason() *string {
}

reason := f.deprecation.Arguments.ForName("reason")
if reason == nil {
return nil

if f.IsDeprecated() {
if reason == nil {
defaultReason := "No longer supported"
return &defaultReason
} else {
return &reason.Value.Raw
}
}

return &reason.Value.Raw
return nil
}

func (f *InputValue) Description() *string {
Expand Down

0 comments on commit 74ec050

Please sign in to comment.