Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Releases: reasonml-community/reason-apollo-hooks

v6.0.0

14 Jan 16:10
Compare
Choose a tag to compare

Major changes

  • #89 changes the response type of the mutate function to not contain the Loading constructor.

As this is a breaking change of API we are releasing as a major version.

Thanks @mbirkegaard!

More examples and more functions bound

08 Jan 13:07
Compare
Choose a tag to compare

We now have more bindings

  • startPolling
  • stopPolling
  • subscribeToMore

Also @Yakimych updated the demos

Thanks @mbirkegaard and @Yakimych!

Support for BuckleScript 7

09 Dec 17:10
Compare
Choose a tag to compare

Support for BuckleScript 7

With https://github.com/Astrocoders/reason-apollo-hooks/pull/64/files merged now you can use reason-apollo-hooks with BuckleScript 7.

BuckleScript 5 users

Remember that only [email protected] is compatible with the new BS. If you are still a user of BuckleScript 5 please use [email protected] and [email protected] intead.

Thanks @MargaretKrutikova !

Simplified usage

05 Dec 13:47
Compare
Choose a tag to compare

Biggest release in a while!
As now with teamwalnut/graphql-ppx#48 we could simplify the API.

Thanks for everyone involved in this, special thanks @jfrolich who first proposed the changes to happen.

How it was

module GetAllPersonsConfig = [%graphql
  {|
  query getAllPersons($skip: Int!, $first: Int!) {
    allPersons(skip: $skip, first: $first) {
      id
      age
      name
    }
  }
|}
];

module GetAllPersonsQuery = ReasonApolloHooks.Query.Make(GetAllPersonsConfig);

let personsPerPage = 10;

[@react.component]
let make = () => {
  let skipRef = React.useRef(0);
  let (simple, full) =
    GetAllPersonsConfig.make(~skip=0, ~first=personsPerPage, ());

How it is now

module GetAllPersonsQuery = [%graphql
  {|
  query getAllPersons($skip: Int!, $first: Int!) {
    allPersons(skip: $skip, first: $first) {
      id
      age
      name
    }
  }
|}
];

let personsPerPage = 10;

[@react.component]
let make = () => {
  let skipRef = React.useRef(0);

  let (simple, full) =
    ApolloHooks.useQuery(
      ~variables=
        GetAllPersonsQuery.makeVariables(~skip=0, ~first=personsPerPage, ()),
      ~notifyOnNetworkStatusChange=true,
      GetAllPersonsQuery.definition,
    );

No more functors!

Additional thanks to: @MargaretKrutikova , @kamilkuz

v2.0.0-beta.1

26 Jun 18:09
Compare
Choose a tag to compare
v2.0.0-beta.1 Pre-release
Pre-release

Major Changes

  • Feat(mutation): update for second argument of apollo hooks: f23745f