From 605dc9f5ac963ce30c96651147a7d2cb49e071bd Mon Sep 17 00:00:00 2001 From: Abhimanyu Singh Gaur <12651351+abhimanyusinghgaur@users.noreply.github.com> Date: Fri, 4 Sep 2020 15:13:08 +0530 Subject: [PATCH] don't generate orderable enum value for list fields --- graphql/schema/gqlschema.go | 2 +- graphql/schema/testdata/schemagen/output/searchables.graphql | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/graphql/schema/gqlschema.go b/graphql/schema/gqlschema.go index cd280acfc0b..c587db2e968 100644 --- a/graphql/schema/gqlschema.go +++ b/graphql/schema/gqlschema.go @@ -1020,7 +1020,7 @@ func addTypeOrderable(schema *ast.Schema, defn *ast.Definition) { } for _, fld := range defn.Fields { - if orderable[fld.Type.Name()] { + if fld.Type.NamedType != "" && orderable[fld.Type.NamedType] { order.EnumValues = append(order.EnumValues, &ast.EnumValueDefinition{Name: fld.Name}) } diff --git a/graphql/schema/testdata/schemagen/output/searchables.graphql b/graphql/schema/testdata/schemagen/output/searchables.graphql index 13c37d1f17a..a3bd9dd5fd7 100755 --- a/graphql/schema/testdata/schemagen/output/searchables.graphql +++ b/graphql/schema/testdata/schemagen/output/searchables.graphql @@ -227,9 +227,6 @@ enum PostOrderable { title titleByEverything text - tags - tagsHash - tagsExact publishByYear publishByMonth publishByDay