Skip to content
New issue

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

default value as parameter failing #52

Closed
ilterpehlivan opened this issue Apr 1, 2024 · 3 comments · Fixed by #53
Closed

default value as parameter failing #52

ilterpehlivan opened this issue Apr 1, 2024 · 3 comments · Fixed by #53
Assignees
Labels
new feature New feautre request

Comments

@ilterpehlivan
Copy link

I have schema with default value in parameter as following example;

Here is the input

type Query {
  test(X: Int = 20): Int
}

when I call the library;

superSchema := gql.Merge(" ", "./test.graphql")

Expected Result:
Successfully parsing

Actual

panic: lib.Error("/Users/test/Development/repo/test.graphql:2:19: unexpected "20"")

goroutine 1 [running]:
github.com/mununki/gqlmerge/lib.errorf(...)
	/Users/test/go/pkg/mod/github.com/mununki/[email protected]/lib/parse.go:14
github.com/mununki/gqlmerge/lib.(*lexer).consumeIdent(0xc000130000, {0x0, 0x0, 0xc000134090?})
	/Users/test/go/pkg/mod/github.com/mununki/[email protected]/lib/lex.go:486 +0x2df
github.com/mununki/gqlmerge/lib.(*Parser).parseArgs(0xc00013dcb0)
	/Users/test/go/pkg/mod/github.com/mununki/[email protected]/lib/parse.go:73 +0x44a
@mununki
Copy link
Owner

mununki commented Apr 2, 2024

Thank you for opening the issue. I've confirmed that the spec describes the default value in the InputValueDefinition https://spec.graphql.org/October2021/#sec-Field-Arguments
Currently, gqlmerge doesn't support this feature. I think it should support this feature as per the spec.

I'll fix it soon.

@mununki
Copy link
Owner

mununki commented Apr 2, 2024

I think it is fixed v0.2.15 #53
Can you check the test output and test with the latest v0.2.15? https://github.com/mununki/gqlmerge/pull/53/files#diff-5654e067131014cd6c16f574ec28be97931ec0b918e27a8cb30b483a13178715

@mununki
Copy link
Owner

mununki commented Apr 2, 2024

Feel free to reopen the issue if you have any issue left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feautre request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants