From 0aa03e92e2142af310371563514e7ba1b1a47aee Mon Sep 17 00:00:00 2001 From: Steve Coffman Date: Mon, 17 Jul 2023 12:33:26 -0400 Subject: [PATCH] Update gqlparser to omit comments (#284) See https://github.com/vektah/gqlparser/pull/271 This updates gqlparser dependency to v2.5.8, which defaults to not including comments. This PR will update the snapshots and generated files to match that. The AST will still include the comments in the dump, so the tweak to that one test in parse_test.go is still necessary, so that remains in place. Signed-off-by: Steve Coffman --- example/generated.go | 1 - ....graphql-ComplexInlineFragments.graphql.go | 18 ------------- ...raphql-ComplexInlineFragments.graphql.json | 2 +- ...s.graphql-ComplexNamedFragments.graphql.go | 2 -- ...graphql-ComplexNamedFragments.graphql.json | 2 +- ...lice.graphql-CustomMarshalSlice.graphql.go | 3 +-- ...ce.graphql-CustomMarshalSlice.graphql.json | 2 +- ...enerate-Flatten.graphql-Flatten.graphql.go | 6 ----- ...erate-Flatten.graphql-Flatten.graphql.json | 2 +- ...tGenerate-Hasura.graphql-Hasura.graphql.go | 1 - ...enerate-Hasura.graphql-Hasura.graphql.json | 2 +- ...ield.graphql-InterfaceListField.graphql.go | 1 - ...ld.graphql-InterfaceListField.graphql.json | 2 +- ...nterfaceListOfListsOfListsField.graphql.go | 1 - ...erfaceListOfListsOfListsField.graphql.json | 2 +- ...ts.graphql-InterfaceNoFragments.graphql.go | 2 -- ....graphql-InterfaceNoFragments.graphql.json | 2 +- ...ives.graphql-MultipleDirectives.graphql.go | 7 +---- ...es.graphql-MultipleDirectives.graphql.json | 2 +- ...ate-Omitempty.graphql-Omitempty.graphql.go | 5 +--- ...e-Omitempty.graphql-Omitempty.graphql.json | 2 +- ...erate-Pointers.graphql-Pointers.graphql.go | 8 +----- ...ate-Pointers.graphql-Pointers.graphql.json | 2 +- ...rsInline.graphql-PointersInline.graphql.go | 9 +------ ...Inline.graphql-PointersInline.graphql.json | 2 +- ...enerate-Pokemon.graphql-Pokemon.graphql.go | 8 ------ ...erate-Pokemon.graphql-Pokemon.graphql.json | 2 +- ...ate-Recursion.graphql-Recursion.graphql.go | 1 - ...e-Recursion.graphql-Recursion.graphql.json | 2 +- ...Mutation.graphql-SimpleMutation.graphql.go | 6 ----- ...tation.graphql-SimpleMutation.graphql.json | 2 +- ...leQueryWithPointerFalseOverride.graphql.go | 1 - ...QueryWithPointerFalseOverride.graphql.json | 2 +- ...ructOption.graphql-StructOption.graphql.go | 3 --- ...ctOption.graphql-StructOption.graphql.json | 2 +- ...ate-TypeNames.graphql-TypeNames.graphql.go | 6 ----- ...e-TypeNames.graphql-TypeNames.graphql.json | 2 +- ...ionalPointer-testdata-queries-generated.go | 1 - go.mod | 2 +- go.sum | 4 +-- internal/integration/generated.go | 26 +------------------ 41 files changed, 27 insertions(+), 131 deletions(-) diff --git a/example/generated.go b/example/generated.go index 20d31fe7..7c1c0f39 100644 --- a/example/generated.go +++ b/example/generated.go @@ -71,7 +71,6 @@ func (v *getViewerViewerUser) GetCreatedAt() time.Time { return v.CreatedAt } // The query or mutation executed by getUser. const getUser_Operation = ` -# getUser gets the given user's name from their username. query getUser ($Login: String!) { user(login: $Login) { theirName: name diff --git a/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go b/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go index 159dfcde..2afdeb4a 100644 --- a/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go @@ -1342,18 +1342,12 @@ func (v *ComplexInlineFragmentsRootTopic) GetName() string { return v.Name } // The query or mutation executed by ComplexInlineFragments. const ComplexInlineFragments_Operation = ` -# We test all the spread cases from docs/DESIGN.md, see there for more context -# on each, as well as various other nonsense. But for abstract-in-abstract -# spreads, we can't test cases (4b) and (4c), where I implements J or vice -# versa, because gqlparser doesn't support interfaces that implement other -# interfaces yet. query ComplexInlineFragments { root { id ... on Topic { schoolGrade } - # (1) object spread in object scope ... on Content { name } @@ -1364,11 +1358,9 @@ query ComplexInlineFragments { ... on Article { text } - # (2) object spread in abstract scope ... on Content { name } - # (4a) abstract spread in abstract scope, I == J ... on HasDuration { duration } @@ -1395,16 +1387,6 @@ query ComplexInlineFragments { } conflictingStuff: randomItem { __typename - # These two have different types! Naming gets complicated. Note GraphQL - # says [1] that you can only have such naming conflicts when the fields are - # both on object-typed spreads (reasonable, so they can never collide) and - # they are of "shapes that can be merged", e.g. both nullable objects, - # which seems very strange to me but is the most interesting case for us - # anyway (since where we could have trouble is naming the result types). - # [1] https://spec.graphql.org/draft/#SameResponseShape() - # TODO(benkraft): This actually generates the wrong thing right now (the - # two thumbnail types get the same name, and one clobbers the other). Fix - # in a follow-up commit. ... on Article { thumbnail { id diff --git a/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.json b/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.json index 455377d7..357c8890 100644 --- a/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "ComplexInlineFragments", - "query": "\n# We test all the spread cases from docs/DESIGN.md, see there for more context\n# on each, as well as various other nonsense. But for abstract-in-abstract\n# spreads, we can't test cases (4b) and (4c), where I implements J or vice\n# versa, because gqlparser doesn't support interfaces that implement other\n# interfaces yet.\nquery ComplexInlineFragments {\n\troot {\n\t\tid\n\t\t... on Topic {\n\t\t\tschoolGrade\n\t\t}\n\t\t# (1) object spread in object scope\n\t\t... on Content {\n\t\t\tname\n\t\t}\n\t}\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\t... on Article {\n\t\t\ttext\n\t\t}\n\t\t# (2) object spread in abstract scope\n\t\t... on Content {\n\t\t\tname\n\t\t}\n\t\t# (4a) abstract spread in abstract scope, I == J\n\t\t... on HasDuration {\n\t\t\tduration\n\t\t}\n\t}\n\trepeatedStuff: randomItem {\n\t\t__typename\n\t\tid\n\t\tid\n\t\turl\n\t\totherId: id\n\t\t... on Article {\n\t\t\tname\n\t\t\ttext\n\t\t\totherName: name\n\t\t}\n\t\t... on Content {\n\t\t\tid\n\t\t\tname\n\t\t\totherName: name\n\t\t}\n\t\t... on HasDuration {\n\t\t\tduration\n\t\t}\n\t}\n\tconflictingStuff: randomItem {\n\t\t__typename\n\t\t# These two have different types! Naming gets complicated. Note GraphQL\n\t\t# says [1] that you can only have such naming conflicts when the fields are\n\t\t# both on object-typed spreads (reasonable, so they can never collide) and\n\t\t# they are of \"shapes that can be merged\", e.g. both nullable objects,\n\t\t# which seems very strange to me but is the most interesting case for us\n\t\t# anyway (since where we could have trouble is naming the result types).\n\t\t# [1] https://spec.graphql.org/draft/#SameResponseShape()\n\t\t# TODO(benkraft): This actually generates the wrong thing right now (the\n\t\t# two thumbnail types get the same name, and one clobbers the other). Fix\n\t\t# in a follow-up commit.\n\t\t... on Article {\n\t\t\tthumbnail {\n\t\t\t\tid\n\t\t\t\tthumbnailUrl\n\t\t\t}\n\t\t}\n\t\t... on Video {\n\t\t\tthumbnail {\n\t\t\t\tid\n\t\t\t\ttimestampSec\n\t\t\t}\n\t\t}\n\t}\n\tnestedStuff: randomItem {\n\t\t__typename\n\t\t... on Topic {\n\t\t\tchildren {\n\t\t\t\t__typename\n\t\t\t\tid\n\t\t\t\t... on Article {\n\t\t\t\t\ttext\n\t\t\t\t\tparent {\n\t\t\t\t\t\t... on Content {\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\tparent {\n\t\t\t\t\t\t\t\t... on Topic {\n\t\t\t\t\t\t\t\t\tchildren {\n\t\t\t\t\t\t\t\t\t\t__typename\n\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", + "query": "\nquery ComplexInlineFragments {\n\troot {\n\t\tid\n\t\t... on Topic {\n\t\t\tschoolGrade\n\t\t}\n\t\t... on Content {\n\t\t\tname\n\t\t}\n\t}\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\t... on Article {\n\t\t\ttext\n\t\t}\n\t\t... on Content {\n\t\t\tname\n\t\t}\n\t\t... on HasDuration {\n\t\t\tduration\n\t\t}\n\t}\n\trepeatedStuff: randomItem {\n\t\t__typename\n\t\tid\n\t\tid\n\t\turl\n\t\totherId: id\n\t\t... on Article {\n\t\t\tname\n\t\t\ttext\n\t\t\totherName: name\n\t\t}\n\t\t... on Content {\n\t\t\tid\n\t\t\tname\n\t\t\totherName: name\n\t\t}\n\t\t... on HasDuration {\n\t\t\tduration\n\t\t}\n\t}\n\tconflictingStuff: randomItem {\n\t\t__typename\n\t\t... on Article {\n\t\t\tthumbnail {\n\t\t\t\tid\n\t\t\t\tthumbnailUrl\n\t\t\t}\n\t\t}\n\t\t... on Video {\n\t\t\tthumbnail {\n\t\t\t\tid\n\t\t\t\ttimestampSec\n\t\t\t}\n\t\t}\n\t}\n\tnestedStuff: randomItem {\n\t\t__typename\n\t\t... on Topic {\n\t\t\tchildren {\n\t\t\t\t__typename\n\t\t\t\tid\n\t\t\t\t... on Article {\n\t\t\t\t\ttext\n\t\t\t\t\tparent {\n\t\t\t\t\t\t... on Content {\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\tparent {\n\t\t\t\t\t\t\t\t... on Topic {\n\t\t\t\t\t\t\t\t\tchildren {\n\t\t\t\t\t\t\t\t\t\t__typename\n\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "sourceLocation": "testdata/queries/ComplexInlineFragments.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go b/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go index 589080bf..dbddcee6 100644 --- a/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go @@ -1786,14 +1786,12 @@ fragment ContentFields on Content { name url } -# @genqlient(pointer: true) fragment MoreVideoFields on Video { id parent { name url ... ContentFields - # @genqlient(pointer: false) children { __typename ... VideoFields diff --git a/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.json b/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.json index 70fd401b..114023cd 100644 --- a/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "ComplexNamedFragments", - "query": "\nquery ComplexNamedFragments {\n\t... on Query {\n\t\t... QueryFragment\n\t}\n}\nfragment QueryFragment on Query {\n\t... InnerQueryFragment\n}\nfragment InnerQueryFragment on Query {\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t\t... VideoFields\n\t\t... ContentFields\n\t}\n\trandomLeaf {\n\t\t__typename\n\t\t... VideoFields\n\t\t... MoreVideoFields\n\t\t... ContentFields\n\t}\n\totherLeaf: randomLeaf {\n\t\t__typename\n\t\t... on Video {\n\t\t\t... MoreVideoFields\n\t\t\t... ContentFields\n\t\t}\n\t\t... ContentFields\n\t}\n}\nfragment VideoFields on Video {\n\tid\n\tname\n\turl\n\tduration\n\tthumbnail {\n\t\tid\n\t}\n\t... ContentFields\n}\nfragment ContentFields on Content {\n\tname\n\turl\n}\n# @genqlient(pointer: true)\nfragment MoreVideoFields on Video {\n\tid\n\tparent {\n\t\tname\n\t\turl\n\t\t... ContentFields\n\t\t# @genqlient(pointer: false)\n\t\tchildren {\n\t\t\t__typename\n\t\t\t... VideoFields\n\t\t}\n\t}\n}\n", + "query": "\nquery ComplexNamedFragments {\n\t... on Query {\n\t\t... QueryFragment\n\t}\n}\nfragment QueryFragment on Query {\n\t... InnerQueryFragment\n}\nfragment InnerQueryFragment on Query {\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t\t... VideoFields\n\t\t... ContentFields\n\t}\n\trandomLeaf {\n\t\t__typename\n\t\t... VideoFields\n\t\t... MoreVideoFields\n\t\t... ContentFields\n\t}\n\totherLeaf: randomLeaf {\n\t\t__typename\n\t\t... on Video {\n\t\t\t... MoreVideoFields\n\t\t\t... ContentFields\n\t\t}\n\t\t... ContentFields\n\t}\n}\nfragment VideoFields on Video {\n\tid\n\tname\n\turl\n\tduration\n\tthumbnail {\n\t\tid\n\t}\n\t... ContentFields\n}\nfragment ContentFields on Content {\n\tname\n\turl\n}\nfragment MoreVideoFields on Video {\n\tid\n\tparent {\n\t\tname\n\t\turl\n\t\t... ContentFields\n\t\tchildren {\n\t\t\t__typename\n\t\t\t... VideoFields\n\t\t}\n\t}\n}\n", "sourceLocation": "testdata/queries/ComplexNamedFragments.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go b/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go index 36ebfdf2..0d72eb32 100644 --- a/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go @@ -205,8 +205,7 @@ func (v *__CustomMarshalSliceInput) __premarshalJSON() (*__premarshal__CustomMar // The query or mutation executed by CustomMarshalSlice. const CustomMarshalSlice_Operation = ` -query CustomMarshalSlice ($datesss: [[[Date!]!]!]!, # @genqlient(pointer: true) -$datesssp: [[[Date!]!]!]!) { +query CustomMarshalSlice ($datesss: [[[Date!]!]!]!, $datesssp: [[[Date!]!]!]!) { acceptsListOfListOfListsOfDates(datesss: $datesss) withPointer: acceptsListOfListOfListsOfDates(datesss: $datesssp) } diff --git a/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.json b/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.json index 1c0923c4..be043c1e 100644 --- a/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "CustomMarshalSlice", - "query": "\nquery CustomMarshalSlice ($datesss: [[[Date!]!]!]!, # @genqlient(pointer: true)\n$datesssp: [[[Date!]!]!]!) {\n\tacceptsListOfListOfListsOfDates(datesss: $datesss)\n\twithPointer: acceptsListOfListOfListsOfDates(datesss: $datesssp)\n}\n", + "query": "\nquery CustomMarshalSlice ($datesss: [[[Date!]!]!]!, $datesssp: [[[Date!]!]!]!) {\n\tacceptsListOfListOfListsOfDates(datesss: $datesss)\n\twithPointer: acceptsListOfListOfListsOfDates(datesss: $datesssp)\n}\n", "sourceLocation": "testdata/queries/CustomMarshalSlice.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go b/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go index 012100e9..a18b8576 100644 --- a/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go @@ -268,25 +268,20 @@ func (v *VideoFieldsParentTopic) GetVideoChildren() []ChildVideoFields { return // The query or mutation executed by ComplexNamedFragments. const ComplexNamedFragments_Operation = ` -# @genqlient(flatten: true) query ComplexNamedFragments { ... QueryFragment } -# @genqlient(flatten: true) fragment QueryFragment on Query { ... InnerQueryFragment } fragment InnerQueryFragment on Query { - # @genqlient(flatten: true) randomVideo { ... VideoFields } - # @genqlient(flatten: true) randomItem { __typename ... ContentFields } - # @genqlient(flatten: true) otherVideo: randomVideo { ... ContentFields } @@ -294,7 +289,6 @@ fragment InnerQueryFragment on Query { fragment VideoFields on Video { id parent { - # @genqlient(flatten: true) videoChildren { ... ChildVideoFields } diff --git a/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.json b/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.json index e0490acf..1daf0193 100644 --- a/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "ComplexNamedFragments", - "query": "\n# @genqlient(flatten: true)\nquery ComplexNamedFragments {\n\t... QueryFragment\n}\n# @genqlient(flatten: true)\nfragment QueryFragment on Query {\n\t... InnerQueryFragment\n}\nfragment InnerQueryFragment on Query {\n\t# @genqlient(flatten: true)\n\trandomVideo {\n\t\t... VideoFields\n\t}\n\t# @genqlient(flatten: true)\n\trandomItem {\n\t\t__typename\n\t\t... ContentFields\n\t}\n\t# @genqlient(flatten: true)\n\totherVideo: randomVideo {\n\t\t... ContentFields\n\t}\n}\nfragment VideoFields on Video {\n\tid\n\tparent {\n\t\t# @genqlient(flatten: true)\n\t\tvideoChildren {\n\t\t\t... ChildVideoFields\n\t\t}\n\t}\n}\nfragment ContentFields on Content {\n\tname\n\turl\n}\nfragment ChildVideoFields on Video {\n\tid\n\tname\n}\n", + "query": "\nquery ComplexNamedFragments {\n\t... QueryFragment\n}\nfragment QueryFragment on Query {\n\t... InnerQueryFragment\n}\nfragment InnerQueryFragment on Query {\n\trandomVideo {\n\t\t... VideoFields\n\t}\n\trandomItem {\n\t\t__typename\n\t\t... ContentFields\n\t}\n\totherVideo: randomVideo {\n\t\t... ContentFields\n\t}\n}\nfragment VideoFields on Video {\n\tid\n\tparent {\n\t\tvideoChildren {\n\t\t\t... ChildVideoFields\n\t\t}\n\t}\n}\nfragment ContentFields on Content {\n\tname\n\turl\n}\nfragment ChildVideoFields on Video {\n\tid\n\tname\n}\n", "sourceLocation": "testdata/queries/Flatten.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.go b/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.go index d7d50213..313b82e9 100644 --- a/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.go @@ -83,7 +83,6 @@ func (v *__GetPokemonInput) GetWhere() *GetPokemonBoolExp { return v.Where } // The query or mutation executed by GetPokemon. const GetPokemon_Operation = ` -# @genqlient(pointer: true) query GetPokemon ($where: getPokemonBoolExp!) { getPokemon(where: $where) { species diff --git a/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.json b/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.json index abfc2deb..ede08125 100644 --- a/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-Hasura.graphql-Hasura.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "GetPokemon", - "query": "\n# @genqlient(pointer: true)\nquery GetPokemon ($where: getPokemonBoolExp!) {\n\tgetPokemon(where: $where) {\n\t\tspecies\n\t\tlevel\n\t}\n}\n", + "query": "\nquery GetPokemon ($where: getPokemonBoolExp!) {\n\tgetPokemon(where: $where) {\n\t\tspecies\n\t\tlevel\n\t}\n}\n", "sourceLocation": "testdata/queries/Hasura.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go b/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go index 95faf754..fb2fc307 100644 --- a/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go @@ -532,7 +532,6 @@ query InterfaceListField { name } } - # @genqlient(pointer: true) withPointer: root { id name diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.json b/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.json index 4b4bd42a..e2500e1e 100644 --- a/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "InterfaceListField", - "query": "\nquery InterfaceListField {\n\troot {\n\t\tid\n\t\tname\n\t\tchildren {\n\t\t\t__typename\n\t\t\tid\n\t\t\tname\n\t\t}\n\t}\n\t# @genqlient(pointer: true)\n\twithPointer: root {\n\t\tid\n\t\tname\n\t\tchildren {\n\t\t\t__typename\n\t\t\tid\n\t\t\tname\n\t\t}\n\t}\n}\n", + "query": "\nquery InterfaceListField {\n\troot {\n\t\tid\n\t\tname\n\t\tchildren {\n\t\t\t__typename\n\t\t\tid\n\t\t\tname\n\t\t}\n\t}\n\twithPointer: root {\n\t\tid\n\t\tname\n\t\tchildren {\n\t\t\t__typename\n\t\t\tid\n\t\t\tname\n\t\t}\n\t}\n}\n", "sourceLocation": "testdata/queries/InterfaceListField.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go b/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go index c9da9da9..8b5a6074 100644 --- a/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go @@ -514,7 +514,6 @@ query InterfaceListOfListOfListsField { id name } - # @genqlient(pointer: true) withPointer: listOfListsOfListsOfContent { __typename id diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.json b/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.json index ceb5aa81..178e8721 100644 --- a/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "InterfaceListOfListOfListsField", - "query": "\nquery InterfaceListOfListOfListsField {\n\tlistOfListsOfListsOfContent {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n\t# @genqlient(pointer: true)\n\twithPointer: listOfListsOfListsOfContent {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n}\n", + "query": "\nquery InterfaceListOfListOfListsField {\n\tlistOfListsOfListsOfContent {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n\twithPointer: listOfListsOfListsOfContent {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n}\n", "sourceLocation": "testdata/queries/InterfaceListOfListsOfListsField.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go b/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go index be2daf57..84b2037d 100644 --- a/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go @@ -633,7 +633,6 @@ query InterfaceNoFragmentsQuery { id name } - # (make sure sibling fields work) randomItem { __typename id @@ -644,7 +643,6 @@ query InterfaceNoFragmentsQuery { id name } - # @genqlient(pointer: true) withPointer: randomItem { __typename id diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.json b/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.json index 9c18e0d9..236fd138 100644 --- a/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "InterfaceNoFragmentsQuery", - "query": "\nquery InterfaceNoFragmentsQuery {\n\troot {\n\t\tid\n\t\tname\n\t}\n\t# (make sure sibling fields work)\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n\trandomItemWithTypeName: randomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n\t# @genqlient(pointer: true)\n\twithPointer: randomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n}\n", + "query": "\nquery InterfaceNoFragmentsQuery {\n\troot {\n\t\tid\n\t\tname\n\t}\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n\trandomItemWithTypeName: randomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n\twithPointer: randomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n}\n", "sourceLocation": "testdata/queries/InterfaceNoFragments.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go b/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go index 96901096..356eef40 100644 --- a/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go @@ -327,12 +327,7 @@ func (v *__MultipleDirectivesInput) GetQueries() []*UserQueryInput { return v.Qu // The query or mutation executed by MultipleDirectives. const MultipleDirectives_Operation = ` -# @genqlient(typename: "MyMultipleDirectivesResponse") -# @genqlient(omitempty: true) -# @genqlient(pointer: true) -query MultipleDirectives (# @genqlient(pointer: false) -# @genqlient(typename: "MyInput") -$query: UserQueryInput, $queries: [UserQueryInput]) { +query MultipleDirectives ($query: UserQueryInput, $queries: [UserQueryInput]) { user(query: $query) { id } diff --git a/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.json b/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.json index 9ff15e9e..7e6bbf38 100644 --- a/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "MultipleDirectives", - "query": "\n# @genqlient(typename: \"MyMultipleDirectivesResponse\")\n# @genqlient(omitempty: true)\n# @genqlient(pointer: true)\nquery MultipleDirectives (# @genqlient(pointer: false)\n# @genqlient(typename: \"MyInput\")\n$query: UserQueryInput, $queries: [UserQueryInput]) {\n\tuser(query: $query) {\n\t\tid\n\t}\n\tusers(query: $queries) {\n\t\tid\n\t}\n}\n", + "query": "\nquery MultipleDirectives ($query: UserQueryInput, $queries: [UserQueryInput]) {\n\tuser(query: $query) {\n\t\tid\n\t}\n\tusers(query: $queries) {\n\t\tid\n\t}\n}\n", "sourceLocation": "testdata/queries/MultipleDirectives.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go b/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go index 9c83a079..11c7fb0d 100644 --- a/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go @@ -221,10 +221,7 @@ func (v *__OmitEmptyQueryInput) GetTzNoOmitEmpty() string { return v.TzNoOmitEmp // The query or mutation executed by OmitEmptyQuery. const OmitEmptyQuery_Operation = ` -# @genqlient(omitempty: true) -# @genqlient(for: "UserQueryInput.id", omitempty: false) -query OmitEmptyQuery ($query: UserQueryInput, $queries: [UserQueryInput], $dt: DateTime, $tz: String, # @genqlient(omitempty: false) -$tzNoOmitEmpty: String) { +query OmitEmptyQuery ($query: UserQueryInput, $queries: [UserQueryInput], $dt: DateTime, $tz: String, $tzNoOmitEmpty: String) { user(query: $query) { id } diff --git a/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.json b/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.json index e149f8b4..00629dc7 100644 --- a/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "OmitEmptyQuery", - "query": "\n# @genqlient(omitempty: true)\n# @genqlient(for: \"UserQueryInput.id\", omitempty: false)\nquery OmitEmptyQuery ($query: UserQueryInput, $queries: [UserQueryInput], $dt: DateTime, $tz: String, # @genqlient(omitempty: false)\n$tzNoOmitEmpty: String) {\n\tuser(query: $query) {\n\t\tid\n\t}\n\tusers(query: $queries) {\n\t\tid\n\t}\n\tmaybeConvert(dt: $dt, tz: $tz)\n\tconvert2: maybeConvert(dt: $dt, tz: $tzNoOmitEmpty)\n}\n", + "query": "\nquery OmitEmptyQuery ($query: UserQueryInput, $queries: [UserQueryInput], $dt: DateTime, $tz: String, $tzNoOmitEmpty: String) {\n\tuser(query: $query) {\n\t\tid\n\t}\n\tusers(query: $queries) {\n\t\tid\n\t}\n\tmaybeConvert(dt: $dt, tz: $tz)\n\tconvert2: maybeConvert(dt: $dt, tz: $tzNoOmitEmpty)\n}\n", "sourceLocation": "testdata/queries/Omitempty.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go b/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go index bfb259ba..10058d8e 100644 --- a/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go @@ -232,18 +232,12 @@ func (v *__PointersQueryInput) GetTz() *string { return v.Tz } // The query or mutation executed by PointersQuery. const PointersQuery_Operation = ` -# @genqlient(pointer: true) -# @genqlient(for: "UserQueryInput.id", pointer: false) -# @genqlient(for: "User.id", pointer: false) -query PointersQuery ($query: UserQueryInput, # @genqlient(pointer: false) -$dt: DateTime, $tz: String) { +query PointersQuery ($query: UserQueryInput, $dt: DateTime, $tz: String) { user(query: $query) { - # @genqlient(pointer: true) id roles name emails - # @genqlient(pointer: false) emailsNoPtr: emails } otherUser: user(query: $query) { diff --git a/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.json b/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.json index 68495e05..a5aa1a9c 100644 --- a/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "PointersQuery", - "query": "\n# @genqlient(pointer: true)\n# @genqlient(for: \"UserQueryInput.id\", pointer: false)\n# @genqlient(for: \"User.id\", pointer: false)\nquery PointersQuery ($query: UserQueryInput, # @genqlient(pointer: false)\n$dt: DateTime, $tz: String) {\n\tuser(query: $query) {\n\t\t# @genqlient(pointer: true)\n\t\tid\n\t\troles\n\t\tname\n\t\temails\n\t\t# @genqlient(pointer: false)\n\t\temailsNoPtr: emails\n\t}\n\totherUser: user(query: $query) {\n\t\tid\n\t}\n\tmaybeConvert(dt: $dt, tz: $tz)\n}\n", + "query": "\nquery PointersQuery ($query: UserQueryInput, $dt: DateTime, $tz: String) {\n\tuser(query: $query) {\n\t\tid\n\t\troles\n\t\tname\n\t\temails\n\t\temailsNoPtr: emails\n\t}\n\totherUser: user(query: $query) {\n\t\tid\n\t}\n\tmaybeConvert(dt: $dt, tz: $tz)\n}\n", "sourceLocation": "testdata/queries/Pointers.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go b/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go index 764aa342..99de5637 100644 --- a/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go @@ -229,21 +229,14 @@ func (v *__PointersQueryInput) GetTz() string { return v.Tz } // The query or mutation executed by PointersQuery. const PointersQuery_Operation = ` -query PointersQuery (# @genqlient(pointer: true) -$query: UserQueryInput, # @genqlient(pointer: true) -$dt: DateTime, $tz: String) { - # @genqlient(pointer: true) +query PointersQuery ($query: UserQueryInput, $dt: DateTime, $tz: String) { user(query: $query) { id roles - # @genqlient(pointer: true) name - # @genqlient(pointer: true) emails - # @genqlient(pointer: true) emailsNoPtr: emails } - # @genqlient(pointer: true) otherUser: user(query: $query) { id } diff --git a/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.json b/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.json index 860f7be9..9c358e56 100644 --- a/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "PointersQuery", - "query": "\nquery PointersQuery (# @genqlient(pointer: true)\n$query: UserQueryInput, # @genqlient(pointer: true)\n$dt: DateTime, $tz: String) {\n\t# @genqlient(pointer: true)\n\tuser(query: $query) {\n\t\tid\n\t\troles\n\t\t# @genqlient(pointer: true)\n\t\tname\n\t\t# @genqlient(pointer: true)\n\t\temails\n\t\t# @genqlient(pointer: true)\n\t\temailsNoPtr: emails\n\t}\n\t# @genqlient(pointer: true)\n\totherUser: user(query: $query) {\n\t\tid\n\t}\n\tmaybeConvert(dt: $dt, tz: $tz)\n}\n", + "query": "\nquery PointersQuery ($query: UserQueryInput, $dt: DateTime, $tz: String) {\n\tuser(query: $query) {\n\t\tid\n\t\troles\n\t\tname\n\t\temails\n\t\temailsNoPtr: emails\n\t}\n\totherUser: user(query: $query) {\n\t\tid\n\t}\n\tmaybeConvert(dt: $dt, tz: $tz)\n}\n", "sourceLocation": "testdata/queries/PointersInline.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go b/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go index eafd5183..a14a99f1 100644 --- a/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go @@ -75,21 +75,13 @@ func (v *__GetPokemonSiblingsInput) GetInput() testutil.Pokemon { return v.Input const GetPokemonSiblings_Operation = ` query GetPokemonSiblings ($input: PokemonInput!) { user(query: {hasPokemon:$input}) { - # this will override the default mapping to internal/testutil.ID: - # @genqlient(bind: "string") id - # this is normally an enum, but here we make it a (list of) string: - # @genqlient(bind: "[]string") roles name - # this is mapped globally to internal/testutil.Pokemon: - # note field ordering matters, but whitespace shouldn't. pokemon { species level } - # this overrides said mapping: - # @genqlient(bind: "-") genqlientPokemon: pokemon { species level diff --git a/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.json b/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.json index 73f6aed2..046d2265 100644 --- a/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "GetPokemonSiblings", - "query": "\nquery GetPokemonSiblings ($input: PokemonInput!) {\n\tuser(query: {hasPokemon:$input}) {\n\t\t# this will override the default mapping to internal/testutil.ID:\n\t\t# @genqlient(bind: \"string\")\n\t\tid\n\t\t# this is normally an enum, but here we make it a (list of) string:\n\t\t# @genqlient(bind: \"[]string\")\n\t\troles\n\t\tname\n\t\t# this is mapped globally to internal/testutil.Pokemon:\n\t\t# note field ordering matters, but whitespace shouldn't.\n\t\tpokemon {\n\t\t\tspecies\n\t\t\tlevel\n\t\t}\n\t\t# this overrides said mapping:\n\t\t# @genqlient(bind: \"-\")\n\t\tgenqlientPokemon: pokemon {\n\t\t\tspecies\n\t\t\tlevel\n\t\t}\n\t}\n}\n", + "query": "\nquery GetPokemonSiblings ($input: PokemonInput!) {\n\tuser(query: {hasPokemon:$input}) {\n\t\tid\n\t\troles\n\t\tname\n\t\tpokemon {\n\t\t\tspecies\n\t\t\tlevel\n\t\t}\n\t\tgenqlientPokemon: pokemon {\n\t\t\tspecies\n\t\t\tlevel\n\t\t}\n\t}\n}\n", "sourceLocation": "testdata/queries/Pokemon.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go b/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go index 49a03906..a04627f7 100644 --- a/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go @@ -72,7 +72,6 @@ func (v *__RecursionInput) GetInput() RecursiveInput { return v.Input } const Recursion_Operation = ` query Recursion ($input: RecursiveInput!) { recur(input: $input) { - # (sadly, or happily, GraphQL doesn't let us recur infinitely here) rec { rec { rec { diff --git a/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.json b/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.json index 80e79dbc..44fb4fbc 100644 --- a/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "Recursion", - "query": "\nquery Recursion ($input: RecursiveInput!) {\n\trecur(input: $input) {\n\t\t# (sadly, or happily, GraphQL doesn't let us recur infinitely here)\n\t\trec {\n\t\t\trec {\n\t\t\t\trec {\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", + "query": "\nquery Recursion ($input: RecursiveInput!) {\n\trecur(input: $input) {\n\t\trec {\n\t\t\trec {\n\t\t\t\trec {\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "sourceLocation": "testdata/queries/Recursion.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go b/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go index e9fbada3..f99df88a 100644 --- a/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go @@ -43,12 +43,6 @@ func (v *__SimpleMutationInput) GetName() string { return v.Name } // The query or mutation executed by SimpleMutation. const SimpleMutation_Operation = ` -# @genqlient -# -# SimpleMutation creates a user. -# -# It has a long doc-comment, to test that we handle that correctly. -# What a long comment indeed. mutation SimpleMutation ($name: String!) { createUser(name: $name) { id diff --git a/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.json b/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.json index 498fc965..a6302391 100644 --- a/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "SimpleMutation", - "query": "\n# @genqlient\n#\n# SimpleMutation creates a user.\n#\n# It has a long doc-comment, to test that we handle that correctly.\n# What a long comment indeed.\nmutation SimpleMutation ($name: String!) {\n\tcreateUser(name: $name) {\n\t\tid\n\t\tname\n\t}\n}\n", + "query": "\nmutation SimpleMutation ($name: String!) {\n\tcreateUser(name: $name) {\n\t\tid\n\t\tname\n\t}\n}\n", "sourceLocation": "testdata/queries/SimpleMutation.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.go b/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.go index 0d35d29f..8bb9e368 100644 --- a/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.go @@ -44,7 +44,6 @@ const SimpleQueryWithPointerFalseOverride_Operation = ` query SimpleQueryWithPointerFalseOverride { user { id - # @genqlient(pointer: false) name } } diff --git a/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.json b/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.json index 9c1b1054..9051fead 100644 --- a/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-SimpleQueryWithPointerFalseOverride.graphql-SimpleQueryWithPointerFalseOverride.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "SimpleQueryWithPointerFalseOverride", - "query": "\nquery SimpleQueryWithPointerFalseOverride {\n\tuser {\n\t\tid\n\t\t# @genqlient(pointer: false)\n\t\tname\n\t}\n}\n", + "query": "\nquery SimpleQueryWithPointerFalseOverride {\n\tuser {\n\t\tid\n\t\tname\n\t}\n}\n", "sourceLocation": "testdata/queries/SimpleQueryWithPointerFalseOverride.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go b/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go index 5e381606..1cf05a36 100644 --- a/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go @@ -426,7 +426,6 @@ func (v *VideoFields) GetDuration() int { return v.Duration } // The query or mutation executed by StructOption. const StructOption_Operation = ` -# @genqlient(struct: true) query StructOption { root { id @@ -439,7 +438,6 @@ query StructOption { __typename id } - # (it won't apply to this) interfaceChildren: children { __typename id @@ -448,7 +446,6 @@ query StructOption { } } } - # (nor this) user { roles } diff --git a/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.json b/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.json index 2143578a..3d3aa7a4 100644 --- a/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "StructOption", - "query": "\n# @genqlient(struct: true)\nquery StructOption {\n\troot {\n\t\tid\n\t\tchildren {\n\t\t\t__typename\n\t\t\tid\n\t\t\tparent {\n\t\t\t\tid\n\t\t\t\tchildren {\n\t\t\t\t\t__typename\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t\t# (it won't apply to this)\n\t\t\t\tinterfaceChildren: children {\n\t\t\t\t\t__typename\n\t\t\t\t\tid\n\t\t\t\t\t... VideoFields\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t# (nor this)\n\tuser {\n\t\troles\n\t}\n}\nfragment VideoFields on Video {\n\tduration\n}\n", + "query": "\nquery StructOption {\n\troot {\n\t\tid\n\t\tchildren {\n\t\t\t__typename\n\t\t\tid\n\t\t\tparent {\n\t\t\t\tid\n\t\t\t\tchildren {\n\t\t\t\t\t__typename\n\t\t\t\t\tid\n\t\t\t\t}\n\t\t\t\tinterfaceChildren: children {\n\t\t\t\t\t__typename\n\t\t\t\t\tid\n\t\t\t\t\t... VideoFields\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tuser {\n\t\troles\n\t}\n}\nfragment VideoFields on Video {\n\tduration\n}\n", "sourceLocation": "testdata/queries/StructOption.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go b/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go index cb4e68a6..b05f5d5f 100644 --- a/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go +++ b/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go @@ -266,22 +266,16 @@ func (v *User) GetName() string { return v.Name } // The query or mutation executed by TypeNames. const TypeNames_Operation = ` -# @genqlient(typename: "Resp") query TypeNames { - # @genqlient(typename: "User") user { id name } - # @genqlient(typename: "Item") randomItem { __typename id - # @genqlient(typename: "NameType") name } - # (ok to reuse the name as long as they match) - # @genqlient(typename: "User") users { id name diff --git a/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.json b/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.json index 17c11bf1..3d8e0f34 100644 --- a/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.json +++ b/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.json @@ -2,7 +2,7 @@ "operations": [ { "operationName": "TypeNames", - "query": "\n# @genqlient(typename: \"Resp\")\nquery TypeNames {\n\t# @genqlient(typename: \"User\")\n\tuser {\n\t\tid\n\t\tname\n\t}\n\t# @genqlient(typename: \"Item\")\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\t# @genqlient(typename: \"NameType\")\n\t\tname\n\t}\n\t# (ok to reuse the name as long as they match)\n\t# @genqlient(typename: \"User\")\n\tusers {\n\t\tid\n\t\tname\n\t}\n}\n", + "query": "\nquery TypeNames {\n\tuser {\n\t\tid\n\t\tname\n\t}\n\trandomItem {\n\t\t__typename\n\t\tid\n\t\tname\n\t}\n\tusers {\n\t\tid\n\t\tname\n\t}\n}\n", "sourceLocation": "testdata/queries/TypeNames.graphql" } ] diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-OptionalPointer-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-OptionalPointer-testdata-queries-generated.go index f33724d7..e547f818 100644 --- a/generate/testdata/snapshots/TestGenerateWithConfig-OptionalPointer-testdata-queries-generated.go +++ b/generate/testdata/snapshots/TestGenerateWithConfig-OptionalPointer-testdata-queries-generated.go @@ -245,7 +245,6 @@ const SimpleQueryWithPointerFalseOverride_Operation = ` query SimpleQueryWithPointerFalseOverride { user { id - # @genqlient(pointer: false) name } } diff --git a/go.mod b/go.mod index 43324052..bac27203 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/alexflint/go-arg v1.4.2 github.com/bradleyjkemp/cupaloy/v2 v2.6.0 github.com/stretchr/testify v1.8.2 - github.com/vektah/gqlparser/v2 v2.5.7 + github.com/vektah/gqlparser/v2 v2.5.8 golang.org/x/tools v0.9.3 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index adef0657..4321f309 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/vektah/gqlparser/v2 v2.5.7 h1:QnW4lWFSaycZ1jqvVaQ/tDXGGzQfqAuWdyC4S9g/KVM= -github.com/vektah/gqlparser/v2 v2.5.7/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME= +github.com/vektah/gqlparser/v2 v2.5.8 h1:pm6WOnGdzFOCfcQo9L3+xzW51mKrlwTEg4Wr7AH1JW4= +github.com/vektah/gqlparser/v2 v2.5.8/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= diff --git a/internal/integration/generated.go b/internal/integration/generated.go index f1a27ab2..bce3bf0e 100644 --- a/internal/integration/generated.go +++ b/internal/integration/generated.go @@ -3080,7 +3080,6 @@ func (v *simpleQueryResponse) GetMe() simpleQueryMeUser { return v.Me } // The query or mutation executed by createUser. const createUser_Operation = ` -# @genqlient mutation createUser ($user: NewUser!) { createUser(input: $user) { id @@ -3117,7 +3116,6 @@ func createUser( // The query or mutation executed by failingQuery. const failingQuery_Operation = ` -# @genqlient query failingQuery { fail me { @@ -3150,7 +3148,6 @@ func failingQuery( // The query or mutation executed by queryWithCustomMarshal. const queryWithCustomMarshal_Operation = ` -# @genqlient query queryWithCustomMarshal ($date: Date!) { usersBornOn(date: $date) { id @@ -3188,10 +3185,7 @@ func queryWithCustomMarshal( // The query or mutation executed by queryWithCustomMarshalOptional. const queryWithCustomMarshalOptional_Operation = ` -# @genqlient -query queryWithCustomMarshalOptional (# @genqlient(pointer: true) -$date: Date, # @genqlient(pointer: true) -$id: ID) { +query queryWithCustomMarshalOptional ($date: Date, $id: ID) { userSearch(birthdate: $date, id: $id) { id name @@ -3230,7 +3224,6 @@ func queryWithCustomMarshalOptional( // The query or mutation executed by queryWithCustomMarshalSlice. const queryWithCustomMarshalSlice_Operation = ` -# @genqlient query queryWithCustomMarshalSlice ($dates: [Date!]!) { usersBornOnDates(dates: $dates) { id @@ -3268,7 +3261,6 @@ func queryWithCustomMarshalSlice( // The query or mutation executed by queryWithFlatten. const queryWithFlatten_Operation = ` -# @genqlient(flatten: true) query queryWithFlatten ($ids: [ID!]!) { ... QueryFragment } @@ -3278,7 +3270,6 @@ fragment QueryFragment on Query { id ... FlattenedUserFields ... on Animal { - # @genqlient(flatten: true) owner { __typename ... BeingFields @@ -3286,16 +3277,12 @@ fragment QueryFragment on Query { } } } -# @genqlient(flatten: true) fragment FlattenedUserFields on User { ... FlattenedLuckyFields } -# @genqlient -# @genqlient(flatten: true) fragment BeingFields on Being { ... InnerBeingFields } -# @genqlient(flatten: true) fragment FlattenedLuckyFields on Lucky { ... InnerLuckyFields } @@ -3303,7 +3290,6 @@ fragment InnerBeingFields on Being { id name ... on User { - # @genqlient(flatten: true) friends { ... FriendsFields } @@ -3346,7 +3332,6 @@ func queryWithFlatten( // The query or mutation executed by queryWithFragments. const queryWithFragments_Operation = ` -# @genqlient query queryWithFragments ($ids: [ID!]!) { beings(ids: $ids) { __typename @@ -3412,7 +3397,6 @@ func queryWithFragments( // The query or mutation executed by queryWithInterfaceListField. const queryWithInterfaceListField_Operation = ` -# @genqlient query queryWithInterfaceListField ($ids: [ID!]!) { beings(ids: $ids) { __typename @@ -3450,9 +3434,7 @@ func queryWithInterfaceListField( // The query or mutation executed by queryWithInterfaceListPointerField. const queryWithInterfaceListPointerField_Operation = ` -# @genqlient query queryWithInterfaceListPointerField ($ids: [ID!]!) { - # @genqlient(pointer: true) beings(ids: $ids) { __typename id @@ -3489,7 +3471,6 @@ func queryWithInterfaceListPointerField( // The query or mutation executed by queryWithInterfaceNoFragments. const queryWithInterfaceNoFragments_Operation = ` -# @genqlient query queryWithInterfaceNoFragments ($id: ID!) { being(id: $id) { __typename @@ -3539,7 +3520,6 @@ query queryWithNamedFragments ($ids: [ID!]!) { ... UserFields } } -# @genqlient fragment AnimalFields on Animal { id hair { @@ -3597,7 +3577,6 @@ func queryWithNamedFragments( // The query or mutation executed by queryWithOmitempty. const queryWithOmitempty_Operation = ` -# @genqlient(omitempty: true) query queryWithOmitempty ($id: ID) { user(id: $id) { id @@ -3635,7 +3614,6 @@ func queryWithOmitempty( // The query or mutation executed by queryWithVariables. const queryWithVariables_Operation = ` -# @genqlient query queryWithVariables ($id: ID!) { user(id: $id) { id @@ -3673,7 +3651,6 @@ func queryWithVariables( // The query or mutation executed by simpleQuery. const simpleQuery_Operation = ` -# @genqlient query simpleQuery { me { id @@ -3707,7 +3684,6 @@ func simpleQuery( // The query or mutation executed by simpleQueryExt. const simpleQueryExt_Operation = ` -# @genqlient query simpleQueryExt { me { id