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

Commit

Permalink
Flow tweaks (#752)
Browse files Browse the repository at this point in the history
* increase setTimeout for intermittent test failre

* fix some flow types from usage

* update changelog and version

* better tupe respone

* ignore apollo client flow tests
  • Loading branch information
James Baxley authored Jun 4, 2017
1 parent 62459c9 commit 2baa056
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
.*/examples/**/.*
.*/node_modules/art/.*
.*/node_modules/react-native/**/.*
.*/node_modules/apollo-client/test/**/.*

[include]

[libs]
./node_modules/apollo-client/index.js.flow
./index.js.flow

[options]
Expand Down
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### vNext

### 1.4.2
- Fix: Fix component reference and variable statement for flow types

### 1.4.1
- Fix: Fix compilation of test-utils from move to ES bundles

Expand Down
17 changes: 7 additions & 10 deletions index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type {
} from "apollo-client";
import type { Store } from "redux";
import type { DocumentNode, VariableDefinitionNode } from "graphql";
import type { Component } from "react";

declare module "react-apollo" {
declare type StatelessComponent<P> = (props: P) => ?React$Element<any>;
Expand Down Expand Up @@ -45,16 +46,14 @@ declare module "react-apollo" {
} & P;

declare export interface MutationOpts {
variables?: { [key: string]: mixed },
variables?: Object,
optimisticResponse?: Object,
updateQueries?: MutationQueryReducersMap,
}

declare export interface QueryOpts {
ssr?: boolean,
variables?: {
[key: string]: mixed,
},
variables?: Object,
fetchPolicy?: FetchPolicy,
pollInterval?: number,
skip?: boolean,
Expand All @@ -64,13 +63,11 @@ declare module "react-apollo" {
error?: ApolloError,
networkStatus: number,
loading: boolean,
variables: {
[variable: string]: any,
},
variables: Object,
fetchMore: (
fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions
) => Promise<ApolloQueryResult<any>>,
refetch: (variables?: any) => Promise<ApolloQueryResult<any>>,
refetch: (variables?: Object) => Promise<ApolloQueryResult<any>>,
startPolling: (pollInterval: number) => void,
stopPolling: () => void,
subscribeToMore: (options: SubscribeToMoreOptions) => () => void,
Expand Down Expand Up @@ -107,8 +104,8 @@ declare module "react-apollo" {
(
component:
| StatelessComponent<TMergedProps>
| React$Component<*, TMergedProps, *>
): React$Component<*, TOwnProps, *>,
| React$Component<void, TMergedProps, void>
): Class<React$Component<void, TOwnProps, void>>,
}

declare export function graphql<TResult, TProps, TChildProps>(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-apollo",
"version": "1.4.1",
"version": "1.4.2",
"description": "React data container for Apollo Client",
"main": "lib/react-apollo.umd.js",
"module": "./lib/index.js",
Expand Down

0 comments on commit 2baa056

Please sign in to comment.