Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
type graphql.options.skip HOC property (#2208)
Browse files Browse the repository at this point in the history
* type graphql.options.skip HOC property

* Changelog update

* Test adjustment to accommodate type change
  • Loading branch information
jameslaneconkling authored and hwillson committed Aug 22, 2018
1 parent 8ef0b75 commit 3da0b0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
- Remove duplicate `FetchMoreOptions` and `FetchMoreQueryOptions` types, and
instead import them from Apollo Client. <br/>
[@skovy](https://github.com/skovy) in [#2281](https://github.com/apollographql/react-apollo/pull/2281)
- Type changes for the `graphql` HOC `options.skip` property. <br/>
[@jameslaneconkling](https://github.com/jameslaneconkling) in [#2208](https://github.com/apollographql/react-apollo/pull/2208)

## 2.1.11 (August 9, 2018)

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export interface OperationOption<
props: OptionProps<TProps, TData, TGraphQLVariables>,
lastProps?: TChildProps | void,
) => TChildProps;
skip?: boolean | ((props: any) => boolean);
skip?: boolean | ((props: TProps) => boolean);
name?: string;
withRef?: boolean;
shouldResubscribe?: (props: TProps, nextProps: TProps) => boolean;
Expand Down
2 changes: 1 addition & 1 deletion test/client/getDataFromTree.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ describe('SSR', () => {

type WithUserChildProps = ChildProps<Props, UserQueryData, UserQueryVariables>;
const withUser = graphql<WithIdChildProps, UserQueryData, UserQueryVariables>(userQuery, {
skip: ({ data: { loading } }) => loading,
skip: ({ data }) => data!.loading,
options: ({ data }) => ({
variables: { id: data!.currentUser!.id },
}),
Expand Down

0 comments on commit 3da0b0d

Please sign in to comment.