Skip to content

= is not allowed in path #4699

@mastorm

Description

@mastorm

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @graphql-tools/utils@8.10.1 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions