@swan-io/graphql-client
Advanced tools
Comparing version 0.1.0-alpha15 to 0.1.0-alpha17
@@ -1138,4 +1138,8 @@ 'use strict'; | ||
); | ||
const reset = react.useCallback(() => { | ||
setIsQuerying(false); | ||
setStableVariables(boxed.Option.None()); | ||
}, []); | ||
const asyncDataToExpose = isQuerying ? boxed.AsyncData.Loading() : asyncData; | ||
return [asyncDataToExpose, exposedRunQuery]; | ||
return [asyncDataToExpose, { query: exposedRunQuery, reset }]; | ||
}; | ||
@@ -1142,0 +1146,0 @@ exports.useMutation = (mutation) => { |
@@ -13,3 +13,6 @@ import { AsyncData, Result, Future } from '@swan-io/boxed'; | ||
AsyncData<Result<Data, ClientError>>, | ||
(variables: Variables) => Future<Result<Data, ClientError>> | ||
{ | ||
query: (variables: Variables) => Future<Result<Data, ClientError>>; | ||
reset: () => void; | ||
} | ||
]; | ||
@@ -16,0 +19,0 @@ declare const useDeferredQuery: <Data, Variables>(query: TypedDocumentNode<Data, Variables>, { optimize, debounce }?: DeferredQueryConfig) => DeferredQuery<Data, Variables>; |
{ | ||
"name": "@swan-io/graphql-client", | ||
"version": "0.1.0-alpha15", | ||
"version": "0.1.0-alpha17", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A simple, typesafe GraphQL client for React", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291483
2827