From 07ffcc821c7fbeb9fea3c6b0916367a48f7d5b82 Mon Sep 17 00:00:00 2001 From: Abhimanyu Singh Gaur Date: Thu, 13 Feb 2020 22:30:17 +0530 Subject: [PATCH] Respect includeDeprecated for EnuValues --- graphql/introspection/type.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graphql/introspection/type.go b/graphql/introspection/type.go index 9aceebdc95..16af79b6b6 100644 --- a/graphql/introspection/type.go +++ b/graphql/introspection/type.go @@ -152,6 +152,10 @@ func (t *Type) EnumValues(includeDeprecated bool) []EnumValue { res := []EnumValue{} for _, val := range t.def.EnumValues { + if !includeDeprecated && val.Directives.ForName("deprecated") != nil { + continue + } + res = append(res, EnumValue{ Name: val.Name, Description: val.Description,