@shopify/react-graphql
Advanced tools
Comparing version 0.0.0-snapshot-20230727180041 to 0.0.0-snapshot-20230901173601
@@ -11,4 +11,3 @@ 'use strict'; | ||
id, | ||
load, | ||
client | ||
load | ||
}) { | ||
@@ -28,3 +27,3 @@ const resolver = async.createResolver({ | ||
const load = usePreload(); | ||
return backgroundQuery.useBackgroundQuery(load, options, client); | ||
return backgroundQuery.useBackgroundQuery(load, options); | ||
} | ||
@@ -37,3 +36,3 @@ | ||
...options | ||
}, client); | ||
}); | ||
} | ||
@@ -40,0 +39,0 @@ |
@@ -8,4 +8,4 @@ 'use strict'; | ||
function useBackgroundQuery(load, options, overrideClient) { | ||
const client = apolloClient["default"](overrideClient); | ||
function useBackgroundQuery(load, options) { | ||
const client = apolloClient["default"](); | ||
const lastClient = React.useRef(client); | ||
@@ -12,0 +12,0 @@ const lastOptions = React.useRef(options); |
import type { DocumentNode } from 'graphql-typed'; | ||
import type { ResolverOptions } from '@shopify/async'; | ||
import type { ApolloClient } from '@apollo/client'; | ||
import type { AsyncDocumentNode } from '../types'; | ||
export interface Options<Data, Variables, DeepPartial> extends ResolverOptions<DocumentNode<Data, Variables, DeepPartial>> { | ||
client?: ApolloClient<any>; | ||
} | ||
export declare function createAsyncQuery<Data extends {}, Variables extends {}, DeepPartial extends {}>({ id, load, client, }: Options<Data, Variables, DeepPartial>): AsyncDocumentNode<Data, Variables, DeepPartial>; | ||
export declare function createAsyncQuery<Data extends {}, Variables extends {}, DeepPartial extends {}>({ id, load, }: Options<Data, Variables, DeepPartial>): AsyncDocumentNode<Data, Variables, DeepPartial>; | ||
//# sourceMappingURL=query.d.ts.map |
import type { DocumentNode } from 'graphql-typed'; | ||
import type { ApolloClient, WatchQueryOptions } from '@apollo/client'; | ||
export declare function useBackgroundQuery(load: () => Promise<DocumentNode | null | Error>, options?: Omit<WatchQueryOptions, 'query'>, overrideClient?: ApolloClient<any>): () => Promise<void>; | ||
import type { WatchQueryOptions } from '@apollo/client'; | ||
export declare function useBackgroundQuery(load: () => Promise<DocumentNode | null | Error>, options?: Omit<WatchQueryOptions, 'query'>): () => Promise<void>; | ||
//# sourceMappingURL=background-query.d.ts.map |
{ | ||
"name": "@shopify/react-graphql", | ||
"version": "0.0.0-snapshot-20230727180041", | ||
"version": "0.0.0-snapshot-20230901173601", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "description": "Tools for creating type-safe and asynchronous GraphQL components for React", | ||
"@shopify/async": "^4.0.3", | ||
"@shopify/react-async": "^5.2.3", | ||
"@shopify/react-async": "0.0.0-snapshot-20230901173601", | ||
"@shopify/react-effect": "^5.0.3", | ||
@@ -32,0 +32,0 @@ "@shopify/react-hooks": "^3.0.5", |
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
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
88865
1223
+ Added@shopify/react-async@0.0.0-snapshot-20230901173601(transitive)
- Removed@shopify/react-async@5.5.3(transitive)