We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Columns are negative for fields with multi-line comments. The below test fails with the following errors:
Error: Not equal: expected: 8 actual : -8 Test: TestSchemaParser/schema_with_multi-line_description Messages: wrong column for 'me'
and
Error: Not equal: expected: 8 actual : -9 Test: TestSchemaParser/schema_with_multi-line_description Messages: wrong column for 'name'
package main import ( "testing" "github.com/stretchr/testify/assert" "github.com/vektah/gqlparser/v2/ast" "github.com/vektah/gqlparser/v2/parser" ) func TestSchemaParser(t *testing.T) { t.Run("schema with multi-line description", func(t *testing.T) { schema, parseErr := parser.ParseSchema(&ast.Source{ Input: `type User { """ name """ name: String! } """ some description """ type query { """ me """ me: User! } `, }) assert.Nil(t, parseErr) queryType := schema.Definitions.ForName("query") for _, field := range queryType.Fields { assert.Equal(t, "me", field.Name) assert.Equal(t, 14, field.Position.Line) assert.Equal(t, 8, field.Position.Column, "wrong column for 'me'") } assert.Equal(t, 11, queryType.Position.Line) assert.Equal(t, 9, queryType.Position.Column) userType := schema.Definitions.ForName("User") for _, field := range userType.Fields { assert.Equal(t, "name", field.Name) assert.Equal(t, 4, field.Position.Line) assert.Equal(t, 8, field.Position.Column, "wrong column for 'name'") } assert.Equal(t, 1, userType.Position.Line) assert.Equal(t, 6, userType.Position.Column) }) }
Columns should not be negative for fields with multiline comments
See above test case
go list -m github.com/vektah/gqlparser/v2
go version
No error occurs on v2.4.6, so I suspect it was introduced in this PR: #230
The text was updated successfully, but these errors were encountered:
Hi! A PR that fixes this without regressing the original problem would be welcome. Thanks!
Sorry, something went wrong.
No branches or pull requests
What happened?
Columns are negative for fields with multi-line comments.
The below test fails with the following errors:
and
What did you expect?
Columns should not be negative for fields with multiline comments
Minimal graphql.schema and models to reproduce
See above test case
versions
go list -m github.com/vektah/gqlparser/v2
? v2.4.7go version
? go1.19.3No error occurs on v2.4.6, so I suspect it was introduced in this PR: #230
The text was updated successfully, but these errors were encountered: