@shopify/react-graphql
Advanced tools
Comparing version 0.0.0-snapshot-20230912183159 to 0.0.0-snapshot-20230921142321
@@ -6,3 +6,3 @@ 'use strict'; | ||
var React = require('react'); | ||
var client = require('@apollo/client'); | ||
var react = require('@apollo/client/react'); | ||
var ApolloContext = require('./ApolloContext.js'); | ||
@@ -15,11 +15,11 @@ | ||
function ApolloProvider({ | ||
client: client$1, | ||
client, | ||
children | ||
}) { | ||
const providerValue = React__default["default"].useMemo(() => ({ | ||
client: client$1, | ||
operations: client$1.__operations_cache__ | ||
}), [client$1]); | ||
return /*#__PURE__*/React__default["default"].createElement(client.ApolloProvider, { | ||
client: client$1 | ||
client, | ||
operations: client.__operations_cache__ | ||
}), [client]); | ||
return /*#__PURE__*/React__default["default"].createElement(react.ApolloProvider, { | ||
client: client | ||
}, /*#__PURE__*/React__default["default"].createElement(ApolloContext.ApolloContext.Provider, { | ||
@@ -26,0 +26,0 @@ value: providerValue |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var React = require('react'); | ||
var client = require('@apollo/client'); | ||
var core = require('@apollo/client/core'); | ||
var isEqual = require('fast-deep-equal'); | ||
@@ -36,9 +36,9 @@ var reactEffect = require('@shopify/react-effect'); | ||
const variables = options.variables || {}; | ||
const client$1 = apolloClient["default"](overrideClient); | ||
const client = apolloClient["default"](overrideClient); | ||
if (typeof window === 'undefined') { | ||
if (skip) { | ||
return createDefaultResult(client$1, variables); | ||
return createDefaultResult(client, variables); | ||
} else if (!ssr || fetchPolicy === 'no-cache') { | ||
return createDefaultResult(client$1, variables, undefined, true); | ||
return createDefaultResult(client, variables, undefined, true); | ||
} | ||
@@ -71,4 +71,4 @@ } | ||
return client$1.watchQuery(watchQueryOptions); | ||
}, [client$1, skip, watchQueryOptions]); | ||
return client.watchQuery(watchQueryOptions); | ||
}, [client, skip, watchQueryOptions]); | ||
reactEffect.useServerEffect(() => { | ||
@@ -82,4 +82,4 @@ if (queryObservable == null) { | ||
}); | ||
const defaultResult = React.useMemo(() => createDefaultResult(client$1, variables, queryObservable), // eslint-disable-next-line react-hooks/exhaustive-deps | ||
[queryObservable, client$1, serializedVariables]); | ||
const defaultResult = React.useMemo(() => createDefaultResult(client, variables, queryObservable), // eslint-disable-next-line react-hooks/exhaustive-deps | ||
[queryObservable, client, serializedVariables]); | ||
const [responseId, setResponseId] = React.useState(0); | ||
@@ -187,3 +187,3 @@ React.useEffect(() => { | ||
data, | ||
error: hasError ? new client.ApolloError({ | ||
error: hasError ? new core.ApolloError({ | ||
graphQLErrors: result.errors | ||
@@ -190,0 +190,0 @@ }) : result.error, |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var async = require('@shopify/async'); | ||
var client = require('@apollo/client'); | ||
var core = require('@apollo/client/core'); | ||
var Query = require('./Query.js'); | ||
@@ -27,7 +27,7 @@ var Prefetch = require('./Prefetch.js'); | ||
enumerable: true, | ||
get: function () { return client.ApolloError; } | ||
get: function () { return core.ApolloError; } | ||
}); | ||
Object.defineProperty(exports, 'NetworkStatus', { | ||
enumerable: true, | ||
get: function () { return client.NetworkStatus; } | ||
get: function () { return core.NetworkStatus; } | ||
}); | ||
@@ -34,0 +34,0 @@ exports.Query = Query.Query; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var client = require('@apollo/client'); | ||
var core = require('@apollo/client/core'); | ||
@@ -11,3 +11,3 @@ function createSsrExtractableLink() { | ||
} | ||
class SsrExtractableLink extends client.ApolloLink { | ||
class SsrExtractableLink extends core.ApolloLink { | ||
constructor(...args) { | ||
@@ -14,0 +14,0 @@ super(...args); |
import React from 'react'; | ||
import type { ApolloClient } from '@apollo/client'; | ||
import type { ApolloClient } from '@apollo/client/core'; | ||
import type { DocumentNode } from 'graphql-typed'; | ||
@@ -4,0 +4,0 @@ export interface ApolloContextValue<CacheShape = any> { |
import React from 'react'; | ||
import type { ApolloClient } from '@apollo/client'; | ||
import type { ApolloClient } from '@apollo/client/core'; | ||
export interface Props<CacheShape> { | ||
@@ -4,0 +4,0 @@ readonly client: ApolloClient<CacheShape>; |
@@ -1,3 +0,3 @@ | ||
import type { ApolloClient } from '@apollo/client'; | ||
import type { ApolloClient } from '@apollo/client/core'; | ||
export default function useApolloClient<CacheShape>(overrideClient?: ApolloClient<CacheShape>): ApolloClient<CacheShape>; | ||
//# sourceMappingURL=apollo-client.d.ts.map |
import type { DocumentNode } from 'graphql-typed'; | ||
import type { WatchQueryOptions } from '@apollo/client'; | ||
import type { WatchQueryOptions } from '@apollo/client/core'; | ||
export declare function useBackgroundQuery(load: () => Promise<DocumentNode | null | Error>, options?: Omit<WatchQueryOptions, 'query'>): () => Promise<void>; | ||
//# sourceMappingURL=background-query.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { OperationVariables } from '@apollo/client'; | ||
import type { OperationVariables } from '@apollo/client/core'; | ||
import type { DocumentNode } from 'graphql-typed'; | ||
@@ -3,0 +3,0 @@ import type { AsyncDocumentNode } from '../types'; |
@@ -1,2 +0,2 @@ | ||
import type { OperationVariables } from '@apollo/client'; | ||
import type { OperationVariables } from '@apollo/client/core'; | ||
import type { DocumentNode } from 'graphql-typed'; | ||
@@ -3,0 +3,0 @@ import type { NoInfer } from '@shopify/useful-types'; |
@@ -1,2 +0,2 @@ | ||
import type { OperationVariables } from '@apollo/client'; | ||
import type { OperationVariables } from '@apollo/client/core'; | ||
import type { DocumentNode } from 'graphql-typed'; | ||
@@ -3,0 +3,0 @@ import type { IfAllNullableKeys, NoInfer } from '@shopify/useful-types'; |
@@ -1,2 +0,3 @@ | ||
import type { ApolloClient, MutationOptions as ClientMutationOptions, QueryResult, OperationVariables, MutationOptions, FetchResult } from '@apollo/client'; | ||
import type { ApolloClient, MutationOptions as ClientMutationOptions, OperationVariables, MutationOptions, FetchResult } from '@apollo/client/core'; | ||
import type { QueryResult } from '@apollo/client/react'; | ||
import type { QueryComponentOptions } from '@apollo/client/react/components'; | ||
@@ -3,0 +4,0 @@ import type { IfAllNullableKeys } from '@shopify/useful-types'; |
export { DeferTiming } from '@shopify/async'; | ||
export { ApolloError, NetworkStatus } from '@apollo/client'; | ||
export { ApolloError, NetworkStatus } from '@apollo/client/core'; | ||
export { Query } from './Query'; | ||
@@ -4,0 +4,0 @@ export { Prefetch } from './Prefetch'; |
@@ -1,3 +0,3 @@ | ||
import type { Operation, NextLink } from '@apollo/client'; | ||
import { ApolloLink } from '@apollo/client'; | ||
import type { Operation, NextLink } from '@apollo/client/core'; | ||
import { ApolloLink } from '@apollo/client/core'; | ||
export declare function createSsrExtractableLink(): SsrExtractableLink; | ||
@@ -7,4 +7,4 @@ export declare class SsrExtractableLink extends ApolloLink { | ||
resolveAll<T>(then: () => T): Promise<T> | T; | ||
request(operation: Operation, nextLink?: NextLink): import("zen-observable-ts").Observable<import("@apollo/client").FetchResult<Record<string, any>, Record<string, any>, Record<string, any>>>; | ||
request(operation: Operation, nextLink?: NextLink): import("zen-observable-ts").Observable<import("@apollo/client/core").FetchResult<Record<string, any>, Record<string, any>, Record<string, any>>>; | ||
} | ||
//# sourceMappingURL=links.d.ts.map |
/// <reference types="react" /> | ||
import type { OperationVariables } from '@apollo/client'; | ||
import type { OperationVariables } from '@apollo/client/core'; | ||
import type { DocumentNode } from 'graphql-typed'; | ||
@@ -4,0 +4,0 @@ import type { QueryHookResult, QueryHookOptions } from './hooks'; |
import type { ReactNode } from 'react'; | ||
import type { DocumentNode, GraphQLOperation, GraphQLData, GraphQLVariables, GraphQLDeepPartial } from 'graphql-typed'; | ||
import type { QueryResult, ErrorPolicy, OperationVariables, ApolloError, ApolloClient, WatchQueryFetchPolicy } from '@apollo/client'; | ||
import type { ErrorPolicy, OperationVariables, ApolloError, ApolloClient, WatchQueryFetchPolicy } from '@apollo/client/core'; | ||
import type { QueryResult } from '@apollo/client/react'; | ||
import type { IfEmptyObject, IfAllNullableKeys } from '@shopify/useful-types'; | ||
@@ -5,0 +6,0 @@ import type { AsyncComponentType, AsyncHookTarget } from '@shopify/react-async'; |
{ | ||
"name": "@shopify/react-graphql", | ||
"version": "0.0.0-snapshot-20230912183159", | ||
"version": "0.0.0-snapshot-20230921142321", | ||
"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": "0.0.0-snapshot-20230912183159", | ||
"@shopify/react-async": "0.0.0-snapshot-20230921142321", | ||
"@shopify/react-effect": "^5.0.3", | ||
@@ -32,0 +32,0 @@ "@shopify/react-hooks": "^3.0.5", |
@@ -31,3 +31,3 @@ # `@shopify/react-graphql` | ||
import {ApolloClient} from '@apollo/client'; | ||
import {ApolloClient} from '@apollo/client/core'; | ||
import {ApolloProvider} from '@shopify/react-graphql'; | ||
@@ -168,3 +168,3 @@ | ||
import React from 'react'; | ||
import {gql} from '@apollo/client'; | ||
import {gql} from '@apollo/client/core'; | ||
import {useApolloClient} from '@shopify/react-graphql'; | ||
@@ -171,0 +171,0 @@ import {Button} from '@shopify/polaris'; |
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
89116
1225
+ Added@shopify/react-async@0.0.0-snapshot-20230921142321(transitive)
- Removed@shopify/react-async@0.0.0-snapshot-20230912183159(transitive)