Hooks
Pre-release
Pre-release
This release includes support for urql
hooks, including useQuery
, useMutation
, and useSubscription
. It also includes additions to support proper type inference of GraphQL requests, such that users get compile-time guarantees that they are accessing data in a fully type-safe way.
Added
- Bindings for
useQuery
,useMutation
, anduseSubscription
. - Bindings for
SubscriptionWithHandler
, which is to be used in cases where a customhandler
function is passed to theSubscription
component to accumulate subscriptions. - The top-level
urql
context object, which exposes aConsumer
andProvider
, is now exposed to the user.
Changed
- Migrated all components and examples to latest ReasonReact syntax (
"jsx: 3"
). - Add proper type inference for hooks and components. This is achieved by passing the entire
graphql_ppx
module to the hooks, which allows them to use theparse
method to infer the return type of data from the request.