From 29e71523fd9c3fff94ba95dd48cca3e3bed2b775 Mon Sep 17 00:00:00 2001 From: mununki <woonki.moon@gmail.com> Date: Tue, 10 Oct 2023 01:04:56 +0900 Subject: [PATCH] fix property name as type or input --- lib/schema.go | 2 +- test/property_type/generated.graphql | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/property_type/generated.graphql diff --git a/lib/schema.go b/lib/schema.go index a30949f..56202f3 100644 --- a/lib/schema.go +++ b/lib/schema.go @@ -372,7 +372,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 diff --git a/test/property_type/generated.graphql b/test/property_type/generated.graphql new file mode 100644 index 0000000..551a252 --- /dev/null +++ b/test/property_type/generated.graphql @@ -0,0 +1,14 @@ +schema { + query: Query + mutation: Mutation + subscription: Subscription +} + +type SomePayload { + type: String! + someKey: String! +} + + + +