Installation
yarn add @urql/vue graphql
# or
npm install --save @urql/vue graphql
Note:
@urql/vue
has a peer dependency onvue@^3.0.0
(Not v2) and doesn't currently plan to be backwards compatible to Vue 2.
A highly customizable and versatile GraphQL client for vue
variables
typing
Submitted by @arkandias (See #3734)sourcesContent
in published packages
Submitted by @kitten (See #3755)hasNext
to the query and mutation results
Submitted by @JoviDeCroock (See #3703)shallowRef
for data variable to avoid extra overhead for heavy objects
Submitted by @yurks (See #3641)shallowRef
to avoid creating deeply reactive objects for heavy objects
Submitted by @negezor (See #3611)args
in reactive
to fix memory leak
Submitted by @negezor (See #3612)variables
(See #3605)
Submitted by @JoviDeCroock (See 118d74b2
)pause
argument on useQuery
and useSubscription
to not be reactive
Submitted by @arkandias (See #3595)@urql/core
as a peer dependency as well as a regular dependency
Submitted by @kitten (See #3579)null
values
Submitted by @kitten (See #3581)useQuery
, useSubscription
, and useMutation
Submitted by @kitten (See #3582)isPaused
and query inputs)
Submitted by @kitten (See #3231)hasNext: true
is set, which indicates deferred or streamed results
Submitted by @kitten (See #3103)sourcesContent
, including additional source files, and had incorrect paths in some of them
Submitted by @kitten (See #3053)wonka@^6.3.0
Submitted by @kitten (See #3104)urql
bindings packages
Submitted by @kitten (See #3079)Client
provided using provideClient
to be used in the same component it's been provided in
Submitted by @kitten (See #3018)variables
properties optional when a type from TypedDocumentNode
has no Variables
or all optional Variables
. Previously this would break for wrappers, e.g. in code generators, or when the type didn't quite match what we'd expect
Submitted by @kitten (See #3022)Variables
generics over from object
default to Variables extends AnyVariables = AnyVariables
. This has been introduced previously in #2607 but some missing ports have been missed due to TypeScript not catching them previously. Depending on your TypeScript version the object
default is incompatible with AnyVariables
, by @kitten (See #2843)useQuery
to fail for promise-based access, if a result is delivered by the Client
immediately, by @kitten (See #2629)wonka@^6.0.0
), which has no breaking changes but is built to target ES2015 and comes with other minor improvements.
The library has fully been migrated to TypeScript which will hopefully help with making contributions easier!, by @kitten (See #2504)@urql/core
in urql
package and CommonJS output for all other CommonJS-first packages. This ensures that Node.js' cjs-module-lexer
can correctly identify re-exports and report them properly. Otherwise, this will lead to a runtime error, by @kitten (See #2485)await executeQuery
, by @JoviDeCroock (See #2410)graphql
to include ^16.0.0
.
As always when upgrading across many packages of urql
, especially including @urql/core
we recommend you to deduplicate dependencies after upgrading, using npm dedupe
or npx yarn-deduplicate
, by @kitten (See #2133)useClient
import as it will now return a Ref<Client>
rather than a Client
, by @JoviDeCroock (See #2047)provideClient
and install
, by @JoviDeCroock (See #1962)variables
proxy before we send it into the client, by @JoviDeCroock (See #1810)useQuery
implementation to utilise the single-source implementation of @urql/core@2.1.0
. This should improve the stability of promisified useQuery()
calls and prevent operations from not being issued in some edge cases, by @kitten (See #1758)useClientHandle()
function has been added. This creates a handle
on which all use*
hooks can be called, like await handle.useQuery(...)
or await handle.useSubscription(...)
which is useful for sequentially chaining hook calls in an async setup()
function or preserve the right instance of a Client
across lifecycle hooks, by @kitten (See #1599)useClient()
function will now throw a more helpful error when it's called outside of any lifecycle hooks, by @kitten (See #1599)pollInterval
option from useQuery
. Please consider adding an interval manually calling executeQuery()
, by @kitten (See #1374)operationName
property from Operation
s. The new Operation.kind
property is now preferred. If you're creating new operations you may also use the makeOperation
utility instead.
When upgrading @urql/core
please ensure that your package manager didn't install any duplicates of it. You may deduplicate it manually using npx yarn-deduplicate
(for Yarn) or npm dedupe
(for npm), by @kitten (See #1357)gql
tag function helper to @urql/core
. This behaves similarly to graphql-tag
but only warns about locally duplicated fragment names rather than globally. It also primes @urql/core
's key cache with the parsed DocumentNode
, by @kitten (See #1187)useQuery
to resolve the lazy promise for Vue Suspense to the latest result that has been requested as per the input to useQuery
, by @kitten (See #1162)useQuery
by turning isPaused
into a ref again, by @LinusBorg (See #1155)PromiseLike
on the returned state passive, by @kitten (See #1159)Initial release