From 930db8c6ef66e715d119373a0955e9700122b05f Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 10 Sep 2024 13:01:14 +0200 Subject: [PATCH] fix: update mutation bindings --- package.json | 8 ++++++-- rescript.json | 2 +- src/ReactQuery.res | 3 +++ yarn.lock | 33 ++++++++++++++++++++++++++++++--- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a8ce840..a653ef5 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ "react-query", "hooks" ], + "repository": { + "url": "https://github.com/DCKT/rescript-react-query" + }, "license": "MIT", "author": { "name": "Thomas Deconinck", @@ -25,7 +28,7 @@ "@rescript/react": "^0.12.1", "@tanstack/react-query": "^5.22.2", "rescript": ">=11.0.0", - "rescript-bun": "^0.4.1" + "rescript-bun": "^0.5.0" }, "scripts": { "build": "rescript build", @@ -40,5 +43,6 @@ ], "engines": { "node": ">=18" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/rescript.json b/rescript.json index d9332db..ab56822 100644 --- a/rescript.json +++ b/rescript.json @@ -21,7 +21,7 @@ "bs-dev-dependencies": ["@rescript/core", "rescript-bun"], "package-specs": [ { - "module": "es6", + "module": "esmodule", "in-source": true } ] diff --git a/src/ReactQuery.res b/src/ReactQuery.res index 67007c2..27416ae 100644 --- a/src/ReactQuery.res +++ b/src/ReactQuery.res @@ -88,6 +88,7 @@ external useQueries: useQueriesOptions<'data> => array> = "use type useMutationOptions<'params, 'data, 'error, 'context> = { mutationFn: 'params => promise<'data>, + gcTime?: int, retry?: retry, retryDelay?: retryDelay, onMutate?: 'params => promise<'context>, @@ -102,6 +103,8 @@ type mutationStatus = | @as("success") Success type mutationState<'params, 'data, 'error, 'context> = { + data: 'data, + error: 'error, isPending: bool, isError: bool, isSuccess: bool, diff --git a/yarn.lock b/yarn.lock index 7bf9854..e347090 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,34 @@ # yarn lockfile v1 +"@rescript/core@^1.0.0": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@rescript/core/-/core-1.5.2.tgz#7c15659c2e1655ca5430dd665ca5a95ae5b64673" + integrity sha512-VWRFHrQu8hWnd9Y9LYZ8kig2urybhZlDVGy5u50bqf2WCRAeysBIfxK8eN4VlpQT38igMo0/uLX1KSpwCVMYGw== + +"@rescript/react@^0.12.1": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@rescript/react/-/react-0.12.2.tgz#a4a216cb317723005387be297008daca106540ff" + integrity sha512-EOF19dLTG4Y9K59JqMjG5yfvIsrMZqfxGC2J/oe9gGgrMiUrzZh3KH9khTcR1Z3Ih0lRViSh0/iYnJz20gGoag== + +"@tanstack/query-core@5.55.4": + version "5.55.4" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.55.4.tgz#21ef6c6505bf108570f1c18f5f3b90efc8b1c2d6" + integrity sha512-uoRqNnRfzOH4OMIoxj8E2+Us89UIGXfau981qYJWsNMkFS1GXR4UIyzUTVGq4N7SDLHgFPpo6IOazqUV5gkMZA== + +"@tanstack/react-query@^5.22.2": + version "5.55.4" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.55.4.tgz#4c8f54a05704e9f9a9ffc77a6dfa79b5a33f9905" + integrity sha512-e3uX5XkLD9oTV66/VsVpkYz3Ds/ps/Yk+V5d89xthAbtNIKKBEm4FdNb9yISFzGEGezUzVO68qmfmiSrtScvsg== + dependencies: + "@tanstack/query-core" "5.55.4" + +rescript-bun@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/rescript-bun/-/rescript-bun-0.5.0.tgz#957f57533f7503cd4e36e622d57346d284d9be7b" + integrity sha512-y7GK+RgQeaC2a8Qam0jZZ+ApTHW32s2bpVOjryeU2pHoNjtNXel7txZyywwEfC5o5rXvF7b12688YW5lO6C5jg== + rescript@>=11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/rescript/-/rescript-11.0.0.tgz#9a0b6fc998c360543c459aba49b77a572a0306cd" - integrity sha512-uIUwDZZmDUb7ymGkBiiGioxMg8hXh1mze/2k/qhYQcZGgi7PrLHQIW9AksM7gb9WnpjCAvFsA8U2VgC0nA468w== + version "11.1.4" + resolved "https://registry.yarnpkg.com/rescript/-/rescript-11.1.4.tgz#9a42ebc4fc5363707e39cef5b3188160b63bee42" + integrity sha512-0bGU0bocihjSC6MsE3TMjHjY0EUpchyrREquLS8VsZ3ohSMD+VHUEwimEfB3kpBI1vYkw3UFZ3WD8R28guz/Vw==