From 27e8d02d5e1763612a955691966608c600138438 Mon Sep 17 00:00:00 2001 From: Dotan Simha Date: Mon, 17 Aug 2020 12:34:16 +0300 Subject: [PATCH] fixes for react-apollo-2 components, bump cli --- examples/apollo-client-2/package.json | 2 +- examples/apollo-client-2/yarn.lock | 8 +-- packages/patch-cli/package.json | 2 +- .../@apollo+react-components+3.1.5.patch | 72 +++++++++++++++++++ .../src/patches/apollo-cache+~1.3.0.patch | 43 +++++++++++ 5 files changed, 121 insertions(+), 6 deletions(-) diff --git a/examples/apollo-client-2/package.json b/examples/apollo-client-2/package.json index 146968b..48a8a91 100644 --- a/examples/apollo-client-2/package.json +++ b/examples/apollo-client-2/package.json @@ -14,7 +14,7 @@ "@graphql-codegen/typescript": "1.17.8", "@graphql-codegen/typescript-operations": "1.17.8", "@graphql-typed-document-node/core": "^3.1.0", - "@graphql-typed-document-node/patch-cli": "^3.0.3", + "@graphql-typed-document-node/patch-cli": "^3.0.4", "@types/node": "14.0.27", "@types/react": "^16.9.46", "apollo-cache": "^1.3.5", diff --git a/examples/apollo-client-2/yarn.lock b/examples/apollo-client-2/yarn.lock index 2012c63..478c26e 100644 --- a/examples/apollo-client-2/yarn.lock +++ b/examples/apollo-client-2/yarn.lock @@ -925,10 +925,10 @@ resolved "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950" integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg== -"@graphql-typed-document-node/patch-cli@^3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@graphql-typed-document-node/patch-cli/-/patch-cli-3.0.3.tgz#e18f4861f2f5a43717af164ffe506880bd0fd333" - integrity sha512-8kGMaobPES2H23nC8o7vhr8Y2PPLDaX239J5RGOMvg2uRkjYQ1rTQCfmLsJOsHjDWlz913RoTlryFE5eR+lLTw== +"@graphql-typed-document-node/patch-cli@^3.0.4": + version "3.0.4" + resolved "https://registry.npmjs.org/@graphql-typed-document-node/patch-cli/-/patch-cli-3.0.4.tgz#9678f380006a858aa4b5423c8e720da44f2adf53" + integrity sha512-7f0olPBvcSqO3ms2Cx56isETDNd3c+j8owFK+p5VA2jsWIvQEtpfoqx7pHjUEh3yH6E7WjM89T43em7JRNXHKw== dependencies: patch-package "6.2.2" semver "7.3.2" diff --git a/packages/patch-cli/package.json b/packages/patch-cli/package.json index e1461b6..61640dd 100644 --- a/packages/patch-cli/package.json +++ b/packages/patch-cli/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-typed-document-node/patch-cli", - "version": "3.0.3", + "version": "3.0.4", "repository": "git@github.com:dotansimha/graphql-typed-document-node.git", "author": "Dotan Simha ", "license": "MIT", diff --git a/packages/patch-cli/src/patches/@apollo+react-components+3.1.5.patch b/packages/patch-cli/src/patches/@apollo+react-components+3.1.5.patch index 8e72d40..afef596 100644 --- a/packages/patch-cli/src/patches/@apollo+react-components+3.1.5.patch +++ b/packages/patch-cli/src/patches/@apollo+react-components+3.1.5.patch @@ -1,3 +1,75 @@ +diff --git a/node_modules/@apollo/react-components/lib/Mutation.d.ts b/node_modules/@apollo/react-components/lib/Mutation.d.ts +index fe10391..bdbda63 100644 +--- a/node_modules/@apollo/react-components/lib/Mutation.d.ts ++++ b/node_modules/@apollo/react-components/lib/Mutation.d.ts +@@ -1,19 +1,4 @@ + /// + import { OperationVariables } from '@apollo/react-common'; +-import PropTypes from 'prop-types'; + import { MutationComponentOptions } from './types'; + export declare function Mutation(props: MutationComponentOptions): JSX.Element | null; +-export declare namespace Mutation { +- const propTypes: { +- mutation: PropTypes.Validator; +- variables: PropTypes.Requireable; +- optimisticResponse: PropTypes.Requireable; +- refetchQueries: PropTypes.Requireable<((...args: any[]) => any) | (string | object | null | undefined)[]>; +- awaitRefetchQueries: PropTypes.Requireable; +- update: PropTypes.Requireable<(...args: any[]) => any>; +- children: PropTypes.Validator<(...args: any[]) => any>; +- onCompleted: PropTypes.Requireable<(...args: any[]) => any>; +- onError: PropTypes.Requireable<(...args: any[]) => any>; +- fetchPolicy: PropTypes.Requireable; +- }; +-} +diff --git a/node_modules/@apollo/react-components/lib/Query.d.ts b/node_modules/@apollo/react-components/lib/Query.d.ts +index da129ed..de30044 100644 +--- a/node_modules/@apollo/react-components/lib/Query.d.ts ++++ b/node_modules/@apollo/react-components/lib/Query.d.ts +@@ -1,21 +1,5 @@ + /// + import { OperationVariables } from '@apollo/react-common'; +-import PropTypes from 'prop-types'; + import { QueryComponentOptions } from './types'; + export declare function Query(props: QueryComponentOptions): JSX.Element | null; +-export declare namespace Query { +- const propTypes: { +- client: PropTypes.Requireable; +- children: PropTypes.Validator<(...args: any[]) => any>; +- fetchPolicy: PropTypes.Requireable; +- notifyOnNetworkStatusChange: PropTypes.Requireable; +- onCompleted: PropTypes.Requireable<(...args: any[]) => any>; +- onError: PropTypes.Requireable<(...args: any[]) => any>; +- pollInterval: PropTypes.Requireable; +- query: PropTypes.Validator; +- variables: PropTypes.Requireable; +- ssr: PropTypes.Requireable; +- partialRefetch: PropTypes.Requireable; +- returnPartialData: PropTypes.Requireable; +- }; +-} ++ +diff --git a/node_modules/@apollo/react-components/lib/Subscription.d.ts b/node_modules/@apollo/react-components/lib/Subscription.d.ts +index b63d3d2..e320783 100644 +--- a/node_modules/@apollo/react-components/lib/Subscription.d.ts ++++ b/node_modules/@apollo/react-components/lib/Subscription.d.ts +@@ -1,15 +1,4 @@ + /// + import { OperationVariables } from '@apollo/react-common'; +-import PropTypes from 'prop-types'; + import { SubscriptionComponentOptions } from './types'; + export declare function Subscription(props: SubscriptionComponentOptions): JSX.Element | null; +\ No newline at end of file +-export declare namespace Subscription { +- const propTypes: { +- subscription: PropTypes.Validator; +- variables: PropTypes.Requireable; +- children: PropTypes.Requireable<(...args: any[]) => any>; +- onSubscriptionData: PropTypes.Requireable<(...args: any[]) => any>; +- onSubscriptionComplete: PropTypes.Requireable<(...args: any[]) => any>; +- shouldResubscribe: PropTypes.Requireable any)>; +- }; +-} diff --git a/node_modules/@apollo/react-components/lib/types.d.ts b/node_modules/@apollo/react-components/lib/types.d.ts index 0c82d57..d9ceb13 100644 --- a/node_modules/@apollo/react-components/lib/types.d.ts diff --git a/packages/patch-cli/src/patches/apollo-cache+~1.3.0.patch b/packages/patch-cli/src/patches/apollo-cache+~1.3.0.patch index 8c490f8..c4ca5ef 100644 --- a/packages/patch-cli/src/patches/apollo-cache+~1.3.0.patch +++ b/packages/patch-cli/src/patches/apollo-cache+~1.3.0.patch @@ -1,3 +1,46 @@ +diff --git a/node_modules/apollo-cache/lib/cache.d.ts b/node_modules/apollo-cache/lib/cache.d.ts +index 7d2c3c3..e04213b 100644 +--- a/node_modules/apollo-cache/lib/cache.d.ts ++++ b/node_modules/apollo-cache/lib/cache.d.ts +@@ -2,7 +2,7 @@ import { DocumentNode } from 'graphql'; + import { DataProxy, Cache } from './types'; + export declare type Transaction = (c: ApolloCache) => void; + export declare abstract class ApolloCache implements DataProxy { +- abstract read(query: Cache.ReadOptions): T | null; ++ abstract read(query: Cache.ReadOptions): T | null; + abstract write(write: Cache.WriteOptions): void; + abstract diff(query: Cache.DiffOptions): Cache.DiffResult; + abstract watch(watch: Cache.WatchOptions): () => void; +@@ -15,8 +15,8 @@ export declare abstract class ApolloCache implements DataProxy { + abstract recordOptimisticTransaction(transaction: Transaction, id: string): void; + transformDocument(document: DocumentNode): DocumentNode; + transformForLink(document: DocumentNode): DocumentNode; +- readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; +- readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; ++ readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; ++ readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; + writeQuery(options: Cache.WriteQueryOptions): void; + writeFragment(options: Cache.WriteFragmentOptions): void; + writeData({ id, data, }: Cache.WriteDataOptions): void; +diff --git a/node_modules/apollo-cache/lib/types/Cache.d.ts b/node_modules/apollo-cache/lib/types/Cache.d.ts +index f73aeb1..dfec0ef 100644 +--- a/node_modules/apollo-cache/lib/types/Cache.d.ts ++++ b/node_modules/apollo-cache/lib/types/Cache.d.ts +@@ -4,12 +4,12 @@ export declare namespace Cache { + interface EvictionResult { + success: Boolean; + } +- interface ReadOptions extends DataProxy.Query { ++ interface ReadOptions extends DataProxy.Query { + rootId?: string; + previousResult?: any; + optimistic: boolean; + } +- interface WriteOptions extends DataProxy.Query { ++ interface WriteOptions extends DataProxy.Query { + dataId: string; + result: TResult; + } diff --git a/node_modules/apollo-cache/lib/types/DataProxy.d.ts b/node_modules/apollo-cache/lib/types/DataProxy.d.ts index 992df92..d3ff21a 100644 --- a/node_modules/apollo-cache/lib/types/DataProxy.d.ts