From c9d68bf8da0c6b73d2d99146ef04059e6915bace Mon Sep 17 00:00:00 2001 From: mununki Date: Tue, 10 Oct 2023 01:22:00 +0900 Subject: [PATCH] fix merge input and interface for property name - input, type --- lib/schema.go | 4 ++-- test/property_type/generated.graphql | 8 ++++++++ test/property_type/schema/Input.graphql | 4 ++++ test/property_type/schema/Interface.graphql | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 test/property_type/schema/Input.graphql create mode 100644 test/property_type/schema/Interface.graphql diff --git a/lib/schema.go b/lib/schema.go index 56202f3..3ed96d7 100644 --- a/lib/schema.go +++ b/lib/schema.go @@ -197,7 +197,7 @@ func (s *Schema) Parse(p *Parser) { fd.Filename = p.lex.filename fd.Line = p.lex.line fd.Column = p.lex.col - name, comments := p.lex.consumeIdent() + name, comments := p.lex.consumeIdent(tokInput, tokType) fd.Name = name.String() fd.Descriptions = comments @@ -291,7 +291,7 @@ func (s *Schema) Parse(p *Parser) { fd.Filename = p.lex.filename fd.Line = p.lex.line fd.Column = p.lex.col - name, comments := p.lex.consumeIdent() + name, comments := p.lex.consumeIdent(tokInput, tokType) fd.Name = name.String() fd.Descriptions = comments p.lex.consumeToken(tokColon) diff --git a/test/property_type/generated.graphql b/test/property_type/generated.graphql index 551a252..4254040 100644 --- a/test/property_type/generated.graphql +++ b/test/property_type/generated.graphql @@ -11,4 +11,12 @@ type SomePayload { +interface I { + type: String! + input: String! +} +input I { + type: String! + input: String! +} diff --git a/test/property_type/schema/Input.graphql b/test/property_type/schema/Input.graphql new file mode 100644 index 0000000..c80991a --- /dev/null +++ b/test/property_type/schema/Input.graphql @@ -0,0 +1,4 @@ +input I { + type: String! + input: String! +} \ No newline at end of file diff --git a/test/property_type/schema/Interface.graphql b/test/property_type/schema/Interface.graphql new file mode 100644 index 0000000..b45e089 --- /dev/null +++ b/test/property_type/schema/Interface.graphql @@ -0,0 +1,4 @@ +interface I { + type: String! + input: String! +} \ No newline at end of file