Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR finally gets us bound to
urql
v1.3.0. There were some challenging pieces to navigate to reach some of these bindings, but the great part is they should have full backwards compatibility 🎉 The core changes this PR introduces (which would comprise a 1.5.0 release for us):extensions
to hooks and components. These are represented using the type parameter'extensions
, as we don't really have any knowledge of what a user's'extensions
will look like beforehand. These get accessed like so:fetch
implementation. If a user really wants to implement their own style offetch
other thanwindow.fetch
, we now allow that. I'm not 💯 on these bindings. I used a GADT similar to how we handledfetchOptions
, since we want to account for a few different ways of potentially setting up a "fetcher", namely:But I'm not totally sure how realistic this.
urql
just usestypeof fetch
to achieve this. I may write some unit tests to see if I can actually get this to work soundly withbs-fetch
.context
argument forexecuteQuery
andexecuteMutation
. Basically, this allows users to alter the operation context of a single query or mutation at a time, rather than using the default options set up in their client. I still need to do some work to convert what a user gives us to somethingurql
can understand, mostly in regards to properly converting the polymorphicrequestPolicy
variant.Fortunately,
urql
v1.4.0 looks like it has very few relevant changes for the bindings, so we're getting over a major hump binding v1.3.0. I'm not 💯 confident in everything I have here, so any suggestions on improvements are welcome! cc/ @sgrove copying you here for visibility as well.