Skip to content

Releases: relay-tools/relay-hooks

v5.0.0

14 Jul 11:29
2c05099
Compare
Choose a tag to compare

Improved

  • Added ESM supports
  • Added unpkg

Improved (not in official relay)

v4.1.1

17 Feb 12:16
Compare
Choose a tag to compare

Fixed

  • Added relay useMutation tests and adapted to relay-hooks version
  • fix optimisticResponse in useMutation, related #150
  • fix to avoid setState in useMutation when hook is unmounted
  • fix loading state when the query is configured in polling #160

v4.1.0

03 Feb 23:55
Compare
Choose a tag to compare

Improved

  • useSubscription, feat: add a skip option for useSubscription #148
  • useMutation, removed the MutationConfigWithVariables type as it is not needed #149
  • useMutation, set mutation data with optistimicResponse while the mutation is in flight #150

Fixed

  • useQuery, fix skip & dispose fetcher #153
  • loadQuery, unsubscribe only if the callback function is still subscribed #154

v3.7.1

03 Feb 23:55
Compare
Choose a tag to compare

Fixed

  • loadQuery, unsubscribe only if the callback function is still subscribed #154

v4.0.0

18 Jan 11:26
Compare
Choose a tag to compare

Breaking Change

  • removed support to Mutation HOC
  • useRefetch no longer exists
  • remove fetchObserver in useQuery in favor of onComplete property
  • changed the return type:
    • useQuery -> const { data, isLoading, error, retry} = useQuery(query, variables); (removed cached and added isLoading)
    • useRefetchable -> const { data, refetch, isLoading, error } = useRefetchable(node, ref); (before [data, refetch])
    • usePagination -> const { data, hasNext, isLoadingNext, hasPrevious, isLoadingPrevious, isLoading, refetch, loadNext, loadPrevious, errorNext, errorPrevious, error } = usePagination(node, ref); (before [ data, { isLoading, hasMore, loadMore } ])
  • usePagination now uses the @refetchable directive

Fixed

  • typesafe onMutation promise #132

Improved

  • added useRefetchableFragment hook with suspense
  • added usePaginationFragment hook with suspense
  • useSuspenseFragment hook with suspense like useFragment in relay-experimental
  • update dependency fbjs
  • support relay-runtime v10.x.x
  • added more tests
  • Added babel dev-expression in order to reduce bundle size
  • Removed warning in StrictMode
  • added example with pagination
  • documentation, useRefetchable, usePagination
  • useMutation typing

v4.0.0-rc.3

13 Jan 19:29
Compare
Choose a tag to compare

Breaking Change

  • removed support to Mutation HOC
  • useRefetch no longer exists
  • remove fetchObserver in useQuery in favor of onComplete property
  • changed the return type:
    • useQuery -> const { data, isLoading, error, retry} = useQuery(query, variables); (removed cached and added isLoading)
    • useRefetchable -> const { data, refetch, isLoading, error } = useRefetchable(node, ref); (before [data, refetch])
    • usePagination -> const { data, hasNext, isLoadingNext, hasPrevious, isLoadingPrevious, isLoading, refetch, loadNext, loadPrevious, errorNext, errorPrevious, error } = usePagination(node, ref); (before [ data, { isLoading, hasMore, loadMore } ])
  • usePagination now use of the @refetchable directive

Improved

  • added useRefetchableFragment hook with suspense
  • added usePaginationFragment hook with suspense
  • useSuspenseFragment hook with suspense like useFragment in relay-experimental
  • update dependency fbjs
  • support relay-runtime v10.x.x
  • added more tests
  • Added babel dev-expression in order to reduce bundle size
  • Removed warning in StrictMode
  • improved example with pagination

v3.7.0

04 Oct 18:54
Compare
Choose a tag to compare

Fixed

  • Fix loadQuery/loadLazyQuery next function issue #115

Improved

  • Better compatibility with react-relay-offline
    • improved typing in order to extend RelayEnvironment
    • export internalLoadQuery and added parameter to extend the function that executes the query

v3.6.0

08 Sep 09:38
Compare
Choose a tag to compare

Improved

  • adds the new option fetchObserver in useQuery and useLazyLoadQuery in order to observe the execution of the query in the network. It also adds a new parameter to the retry function to observe its execution.
  • added rollup for cjs, es and umd bundle generation.

Fixed

  • exporting loadQuery & mutation types

v3.5.2

21 Jul 13:10
Compare
Choose a tag to compare

Fixed

  • #99 added relay-runtime types dependency in order to fix d.ts files

Improved

  • #100 added example with react experimental nextjs-ssr example
    • upgrade next to version 9.4.4
    • upgrade react and react-dom to experimental
    • add reactMode as concurrent on next.config.js
    • remove Suspense Component and use just Suspense oficial api.
    • remove ssr param at withData

such changes also work if you use react-relay/hooks

v3.5.1

03 Jul 16:13
Compare
Choose a tag to compare

Fixed

  • #93 fix connection config typing
  • #92 fix loadMore & refetchConnection arguments typing