urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.54k stars 444 forks source link

fix(core): Allow path-only URLs to be used with GET requests #3514

Closed akrantz01 closed 4 months ago

akrantz01 commented 4 months ago

Summary

Changes query parameter handling to allow path-only URLs (i.e. /api/graphql) passed to fetch to be used with GET requests. This was previously broken as URL would throw a TypeError: Invalid URL as it only works with fully formed URLs.

Extracting the unparsed query parameters is now done manually, so as to not depend on URL. Important to note is that the current method will not handle URLs with fragments (i.e. /api/graphql#fragment) in them, but it is easy to add if desired.

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: 1a0015d63109e088beb344e981942a90cfe23bb8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------- | ----- | | @urql/core | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR