Skip to content

Commit

Permalink
fix parsing arguments with comma
Browse files Browse the repository at this point in the history
  • Loading branch information
mununki committed Aug 4, 2023
1 parent 72a86fa commit 952f9f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *Command) Check() error {
NotEnoughArgs: "❌ Not enough arguments",
OutputFileNeeded: "❌ Output file argument is needed",
WrongOption: "❌ Wrong options",
Version: "v0.2.6",
Version: "v0.2.7",
}

help := flag.Bool("h", false, "show the help")
Expand Down
4 changes: 4 additions & 0 deletions lib/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,10 @@ func ParseArgument(l *Lexer) []*Arg {
}

args = append(args, &arg)

if l.Peek() == ',' {
l.ConsumeToken(',')
}
}
l.ConsumeToken(')')
}
Expand Down
2 changes: 1 addition & 1 deletion test/CheckIfExists.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type Query {
checkIfExists(userId: ID!): CheckIfExistsResponse!
checkIfExists(userId: ID!, name: String): CheckIfExistsResponse!
}

type CheckIfExistsResponse {
Expand Down

0 comments on commit 952f9f7

Please sign in to comment.