diff --git a/Changelog.md b/Changelog.md index 52a246a3c8..a4ef72cf04 100644 --- a/Changelog.md +++ b/Changelog.md @@ -32,6 +32,8 @@ - Remove duplicate `FetchMoreOptions` and `FetchMoreQueryOptions` types, and instead import them from Apollo Client.
[@skovy](https://github.com/skovy) in [#2281](https://github.com/apollographql/react-apollo/pull/2281) +- Type changes for the `graphql` HOC `options.skip` property.
+ [@jameslaneconkling](https://github.com/jameslaneconkling) in [#2208](https://github.com/apollographql/react-apollo/pull/2208) ## 2.1.11 (August 9, 2018) diff --git a/src/types.ts b/src/types.ts index 4fa14c8978..6ae1ad6328 100644 --- a/src/types.ts +++ b/src/types.ts @@ -119,7 +119,7 @@ export interface OperationOption< props: OptionProps, lastProps?: TChildProps | void, ) => TChildProps; - skip?: boolean | ((props: any) => boolean); + skip?: boolean | ((props: TProps) => boolean); name?: string; withRef?: boolean; shouldResubscribe?: (props: TProps, nextProps: TProps) => boolean; diff --git a/test/client/getDataFromTree.test.tsx b/test/client/getDataFromTree.test.tsx index 06cbd7677c..be333bb6cb 100644 --- a/test/client/getDataFromTree.test.tsx +++ b/test/client/getDataFromTree.test.tsx @@ -754,7 +754,7 @@ describe('SSR', () => { type WithUserChildProps = ChildProps; const withUser = graphql(userQuery, { - skip: ({ data: { loading } }) => loading, + skip: ({ data }) => data!.loading, options: ({ data }) => ({ variables: { id: data!.currentUser!.id }, }),