graphql-tools icon indicating copy to clipboard operation
graphql-tools copied to clipboard

= is not allowed in path

Open mastorm opened this issue 3 years ago • 0 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @graphql-tools/[email protected] for the project I'm working on.

In Sveltekit, the equals-sign is used for fragment matching. Its a valid character for a path :(

Here is the diff that solved my problem:

diff --git a/node_modules/@graphql-tools/utils/cjs/helpers.js b/node_modules/@graphql-tools/utils/cjs/helpers.js
index a4fe8e2..17ff3f3 100644
--- a/node_modules/@graphql-tools/utils/cjs/helpers.js
+++ b/node_modules/@graphql-tools/utils/cjs/helpers.js
@@ -25,7 +25,7 @@ function isDocumentString(str) {
     return false;
 }
 exports.isDocumentString = isDocumentString;
-const invalidPathRegex = /[‘“!%^<=>`]/;
+const invalidPathRegex = /[‘“!%^<>`]/;
 function isValidPath(str) {
     return typeof str === 'string' && !invalidPathRegex.test(str);
 }
diff --git a/node_modules/@graphql-tools/utils/esm/helpers.js b/node_modules/@graphql-tools/utils/esm/helpers.js
index d800f95..34d7243 100644
--- a/node_modules/@graphql-tools/utils/esm/helpers.js
+++ b/node_modules/@graphql-tools/utils/esm/helpers.js
@@ -20,7 +20,7 @@ export function isDocumentString(str) {
     catch (e) { }
     return false;
 }
-const invalidPathRegex = /[‘“!%^<=>`]/;
+const invalidPathRegex = /[‘“!%^<>`]/;
 export function isValidPath(str) {
     return typeof str === 'string' && !invalidPathRegex.test(str);
 }

This issue body was partially generated by patch-package.

mastorm avatar Sep 06 '22 06:09 mastorm