diff --git a/src/graphql/graphql.ts b/src/graphql/graphql.ts index 5d4cbd07..438d1a11 100644 --- a/src/graphql/graphql.ts +++ b/src/graphql/graphql.ts @@ -69,16 +69,30 @@ export const language = { // The main tokenizer for our languages tokenizer: { root: [ - // identifiers and keywords + + // fields and argument names [ - /[a-z_$][\w$]*/, + /[a-z_][\w$]*/, { cases: { '@keywords': 'keyword', - '@default': 'identifier', + '@default': 'key.identifier', }, }, ], + + // identify typed input variables + [ + /[$][\w$]*/, + { + cases: { + '@keywords': 'keyword', + '@default': 'argument.identifier', + }, + }, + ], + + // to show class names nicely [ /[A-Z][\w\$]*/, { @@ -87,7 +101,7 @@ export const language = { '@default': 'type.identifier', }, }, - ], // to show class names nicely + ], // whitespace { include: '@whitespace' },