@shopify/react-graphql
Advanced tools
Comparing version 0.0.0-snapshot-20230921142321 to 0.0.0-snapshot-20231019204709
@@ -6,3 +6,3 @@ 'use strict'; | ||
var React = require('react'); | ||
var react = require('@apollo/client/react'); | ||
var client = require('@apollo/client'); | ||
var ApolloContext = require('./ApolloContext.js'); | ||
@@ -15,11 +15,11 @@ | ||
function ApolloProvider({ | ||
client, | ||
client: client$1, | ||
children | ||
}) { | ||
const providerValue = React__default["default"].useMemo(() => ({ | ||
client, | ||
operations: client.__operations_cache__ | ||
}), [client]); | ||
return /*#__PURE__*/React__default["default"].createElement(react.ApolloProvider, { | ||
client: client | ||
client: client$1, | ||
operations: client$1.__operations_cache__ | ||
}), [client$1]); | ||
return /*#__PURE__*/React__default["default"].createElement(client.ApolloProvider, { | ||
client: client$1 | ||
}, /*#__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 core = require('@apollo/client/core'); | ||
var client = require('@apollo/client'); | ||
var isEqual = require('fast-deep-equal'); | ||
@@ -36,9 +36,9 @@ var reactEffect = require('@shopify/react-effect'); | ||
const variables = options.variables || {}; | ||
const client = apolloClient["default"](overrideClient); | ||
const client$1 = apolloClient["default"](overrideClient); | ||
if (typeof window === 'undefined') { | ||
if (skip) { | ||
return createDefaultResult(client, variables); | ||
return createDefaultResult(client$1, variables); | ||
} else if (!ssr || fetchPolicy === 'no-cache') { | ||
return createDefaultResult(client, variables, undefined, true); | ||
return createDefaultResult(client$1, variables, undefined, true); | ||
} | ||
@@ -71,4 +71,4 @@ } | ||
return client.watchQuery(watchQueryOptions); | ||
}, [client, skip, watchQueryOptions]); | ||
return client$1.watchQuery(watchQueryOptions); | ||
}, [client$1, skip, watchQueryOptions]); | ||
reactEffect.useServerEffect(() => { | ||
@@ -82,4 +82,4 @@ if (queryObservable == null) { | ||
}); | ||
const defaultResult = React.useMemo(() => createDefaultResult(client, variables, queryObservable), // eslint-disable-next-line react-hooks/exhaustive-deps | ||
[queryObservable, client, serializedVariables]); | ||
const defaultResult = React.useMemo(() => createDefaultResult(client$1, variables, queryObservable), // eslint-disable-next-line react-hooks/exhaustive-deps | ||
[queryObservable, client$1, serializedVariables]); | ||
const [responseId, setResponseId] = React.useState(0); | ||
@@ -187,3 +187,3 @@ React.useEffect(() => { | ||
data, | ||
error: hasError ? new core.ApolloError({ | ||
error: hasError ? new client.ApolloError({ | ||
graphQLErrors: result.errors | ||
@@ -190,0 +190,0 @@ }) : result.error, |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var async = require('@shopify/async'); | ||
var core = require('@apollo/client/core'); | ||
var client = require('@apollo/client'); | ||
var Query = require('./Query.js'); | ||
@@ -27,7 +27,7 @@ var Prefetch = require('./Prefetch.js'); | ||
enumerable: true, | ||
get: function () { return core.ApolloError; } | ||
get: function () { return client.ApolloError; } | ||
}); | ||
Object.defineProperty(exports, 'NetworkStatus', { | ||
enumerable: true, | ||
get: function () { return core.NetworkStatus; } | ||
get: function () { return client.NetworkStatus; } | ||
}); | ||
@@ -34,0 +34,0 @@ exports.Query = Query.Query; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var core = require('@apollo/client/core'); | ||
var client = require('@apollo/client'); | ||
@@ -11,3 +11,3 @@ function createSsrExtractableLink() { | ||
} | ||
class SsrExtractableLink extends core.ApolloLink { | ||
class SsrExtractableLink extends client.ApolloLink { | ||
constructor(...args) { | ||
@@ -14,0 +14,0 @@ super(...args); |
import React from 'react'; | ||
import type { ApolloClient } from '@apollo/client/core'; | ||
import type { ApolloClient } from '@apollo/client'; | ||
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/core'; | ||
import type { ApolloClient } from '@apollo/client'; | ||
export interface Props<CacheShape> { | ||
@@ -4,0 +4,0 @@ readonly client: ApolloClient<CacheShape>; |
@@ -1,3 +0,3 @@ | ||
import type { ApolloClient } from '@apollo/client/core'; | ||
import type { ApolloClient } from '@apollo/client'; | ||
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/core'; | ||
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 |
@@ -1,2 +0,2 @@ | ||
import type { OperationVariables } from '@apollo/client/core'; | ||
import type { OperationVariables } from '@apollo/client'; | ||
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/core'; | ||
import type { OperationVariables } from '@apollo/client'; | ||
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/core'; | ||
import type { OperationVariables } from '@apollo/client'; | ||
import type { DocumentNode } from 'graphql-typed'; | ||
@@ -3,0 +3,0 @@ import type { IfAllNullableKeys, NoInfer } from '@shopify/useful-types'; |
@@ -1,3 +0,2 @@ | ||
import type { ApolloClient, MutationOptions as ClientMutationOptions, OperationVariables, MutationOptions, FetchResult } from '@apollo/client/core'; | ||
import type { QueryResult } from '@apollo/client/react'; | ||
import type { ApolloClient, MutationOptions as ClientMutationOptions, QueryResult, OperationVariables, MutationOptions, FetchResult } from '@apollo/client'; | ||
import type { QueryComponentOptions } from '@apollo/client/react/components'; | ||
@@ -4,0 +3,0 @@ import type { IfAllNullableKeys } from '@shopify/useful-types'; |
export { DeferTiming } from '@shopify/async'; | ||
export { ApolloError, NetworkStatus } from '@apollo/client/core'; | ||
export { ApolloError, NetworkStatus } from '@apollo/client'; | ||
export { Query } from './Query'; | ||
@@ -4,0 +4,0 @@ export { Prefetch } from './Prefetch'; |
@@ -1,3 +0,3 @@ | ||
import type { Operation, NextLink } from '@apollo/client/core'; | ||
import { ApolloLink } from '@apollo/client/core'; | ||
import type { Operation, NextLink } from '@apollo/client'; | ||
import { ApolloLink } from '@apollo/client'; | ||
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/core").FetchResult<Record<string, any>, Record<string, any>, Record<string, any>>>; | ||
request(operation: Operation, nextLink?: NextLink): import("zen-observable-ts").Observable<import("@apollo/client").FetchResult<Record<string, any>, Record<string, any>, Record<string, any>>>; | ||
} | ||
//# sourceMappingURL=links.d.ts.map |
/// <reference types="react" /> | ||
import type { OperationVariables } from '@apollo/client/core'; | ||
import type { OperationVariables } from '@apollo/client'; | ||
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 { ErrorPolicy, OperationVariables, ApolloError, ApolloClient, WatchQueryFetchPolicy } from '@apollo/client/core'; | ||
import type { QueryResult } from '@apollo/client/react'; | ||
import type { QueryResult, ErrorPolicy, OperationVariables, ApolloError, ApolloClient, WatchQueryFetchPolicy } from '@apollo/client'; | ||
import type { IfEmptyObject, IfAllNullableKeys } from '@shopify/useful-types'; | ||
@@ -6,0 +5,0 @@ import type { AsyncComponentType, AsyncHookTarget } from '@shopify/react-async'; |
{ | ||
"name": "@shopify/react-graphql", | ||
"version": "0.0.0-snapshot-20230921142321", | ||
"version": "0.0.0-snapshot-20231019204709", | ||
"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-20230921142321", | ||
"@shopify/react-async": "0.0.0-snapshot-20231019204709", | ||
"@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/core'; | ||
import {ApolloClient} from '@apollo/client'; | ||
import {ApolloProvider} from '@shopify/react-graphql'; | ||
@@ -168,3 +168,3 @@ | ||
import React from 'react'; | ||
import {gql} from '@apollo/client/core'; | ||
import {gql} from '@apollo/client'; | ||
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
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
88865
1223
+ Added@apollo/client@3.12.2(transitive)
+ Added@shopify/react-async@0.0.0-snapshot-20231019204709(transitive)
+ Addedgraphql@16.9.0(transitive)
- Removed@apollo/client@3.12.3(transitive)
- Removed@shopify/react-async@0.0.0-snapshot-20230921142321(transitive)
- Removedgraphql@16.10.0(transitive)