github urql-graphql/urql v1.5.0

latest releases: @urql/exchange-graphcache@7.1.2, @urql/vue@1.3.2, @urql/vue@1.3.1...
4 years ago

This release finally adds shortcuts to imperatively make queries and mutations.
They make it easier to quickly use the client programmatically, either with
a Wonka source-based or Promise-based call.

// Call .query or .mutation which return Source<OperationResult>
const source = client.query(doc, vars);
const source = client.mutation(doc, vars);
// Call .toPromise() on the source to get Promise<OperationResult>
const promise = client.query(doc, vars).toPromise();
const promise = client.mutation(doc, vars).toPromise();

This version also adds a useClient hook as a shortcut for useContext(Context).
We provide a default client that makes requests to /graphql. Since that has
confused users before, we now log a warning, when it's used.

  • ✨ Implement client.query() and client.mutation() (see #405)
  • Fix useImmediateEffect for concurrent mode (see #418)
  • Deconstruct Wonka.pipe using a Babel transform (see #419)
  • ⚠ Add useClient hook and warning when default client is used (see #420)

Don't miss a new urql release

NewReleases is sending notifications on new releases.