diff --git a/.changeset/giant-jobs-cross.md b/.changeset/giant-jobs-cross.md new file mode 100644 index 0000000000..9d9a277981 --- /dev/null +++ b/.changeset/giant-jobs-cross.md @@ -0,0 +1,5 @@ +--- +'@urql/core': patch +--- + +Fix prevent mangling embedded strings in queries sent using the `GET` method. diff --git a/packages/core/src/internal/fetchOptions.ts b/packages/core/src/internal/fetchOptions.ts index 54bc7760a2..3e470501bb 100644 --- a/packages/core/src/internal/fetchOptions.ts +++ b/packages/core/src/internal/fetchOptions.ts @@ -40,9 +40,7 @@ export const makeFetchURL = ( if (body.query) { search.push( 'query=' + - encodeURIComponent( - body.query.replace(/([\s,]|#[^\n\r]+)+/g, ' ').trim() - ) + encodeURIComponent(body.query.replace(/#[^\n\r]+/g, ' ').trim()) ); }