Releases: reasonml-community/reason-apollo-hooks
v6.0.0
Major changes
- #89 changes the response type of the
mutate
function to not contain theLoading
constructor.
As this is a breaking change of API we are releasing as a major version.
Thanks @mbirkegaard!
More examples and more functions bound
We now have more bindings
- startPolling
- stopPolling
- subscribeToMore
Also @Yakimych updated the demos
Thanks @mbirkegaard and @Yakimych!
Support for BuckleScript 7
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
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
Major Changes
- Feat(mutation): update for second argument of apollo hooks: f23745f