Skip to content

Commit

Permalink
multiple argument syntax highlighting (#3534)
Browse files Browse the repository at this point in the history
  • Loading branch information
johndcollett committed Mar 1, 2024
1 parent e502c41 commit f4c98c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/green-houses-raise.md
@@ -0,0 +1,5 @@
---
'cm6-graphql': patch
---

fix: multiple argument syntax highlighting
10 changes: 10 additions & 0 deletions packages/cm6-graphql/__tests__/cases.txt
Expand Up @@ -145,3 +145,13 @@ Document(
)
)
)

# multiple arguments separated by a commas

{
picture(width: 200, height: 100)
}

==>

Document(OperationDefinition(SelectionSet("{",Selection(Field(FieldName,Arguments("(",Argument(ArgumentAttributeName,IntValue),Argument(ArgumentAttributeName,IntValue),")"))),"}")))
2 changes: 1 addition & 1 deletion packages/cm6-graphql/src/syntax.grammar
Expand Up @@ -291,7 +291,7 @@ Directive { DirectiveName Arguments? }
Arguments { "(" Argument+ ")"}

// https://spec.graphql.org/October2021/#Argument
Argument { ArgumentAttributeName ":" value }
Argument { ArgumentAttributeName ":" value comma? }

ArgumentAttributeName { name }

Expand Down

0 comments on commit f4c98c1

Please sign in to comment.