From 8133a907584e0b3a2832ed4413ccfcfc208689dd Mon Sep 17 00:00:00 2001 From: Valentin Sarychev Date: Tue, 27 Oct 2020 04:23:44 +0300 Subject: [PATCH] Remove $ from invalidPathRegex (#2090) * Remove $ from invalidPathRegex Problem: `@graphql-codegen` silently ignore paths with `$`. Solution: remove `$` from `invalidPathRegex` * changeset Co-authored-by: Arda TANRIKULU --- .changeset/odd-moons-hunt.md | 5 +++++ packages/utils/src/helpers.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/odd-moons-hunt.md diff --git a/.changeset/odd-moons-hunt.md b/.changeset/odd-moons-hunt.md new file mode 100644 index 00000000000..7410543cca0 --- /dev/null +++ b/.changeset/odd-moons-hunt.md @@ -0,0 +1,5 @@ +--- +'@graphql-tools/utils': patch +--- + +fix(utils): Remove \$ from invalidPathRegex diff --git a/packages/utils/src/helpers.ts b/packages/utils/src/helpers.ts index bff8afe38ae..9bf75a42409 100644 --- a/packages/utils/src/helpers.ts +++ b/packages/utils/src/helpers.ts @@ -42,7 +42,7 @@ export function isDocumentString(str: string): boolean { return false; } -const invalidPathRegex = /[‘“!$%&^<=>`]/; +const invalidPathRegex = /[‘“!%&^<=>`]/; export function isValidPath(str: string): boolean { return typeof str === 'string' && !invalidPathRegex.test(str); }