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

Export Context type from types.ts instead of walkTree.ts. #2832

Merged
merged 2 commits into from
Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change log

## vNEXT

### Bug Fixes

- Export `Context` type from `types.ts` instead of `walkTree.ts`,
to reenable `import { Context } from 'react-apollo'` (which has been
broken since 2.4.0). <br/>
[@benjamn](https://github.com/benjamn) in [#2825](https://github.com/apollographql/react-apollo/pull/2832)

## 2.5.1

### Bug Fixes
Expand All @@ -9,7 +18,6 @@
the created test `ApolloClient` instance. <br/>
[@hwillson](https://github.com/hwillson) in [#2825](https://github.com/apollographql/react-apollo/pull/2825)


## 2.5.0

### Improvements
Expand Down
8 changes: 6 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import ApolloClient, {
} from 'apollo-client';
import { MutationFn } from './Mutation';

export interface Context {
[key: string]: any;
};

export type OperationVariables = {
[key: string]: any;
};
Expand All @@ -31,7 +35,7 @@ export interface MutationOpts<TData = any, TGraphQLVariables = OperationVariable
update?: MutationUpdaterFn<TData>;
client?: ApolloClient<any>;
notifyOnNetworkStatusChange?: boolean;
context?: Record<string, any>;
context?: Context;
onCompleted?: (data: TData) => void;
onError?: (error: ApolloError) => void;
fetchPolicy?: FetchPolicy;
Expand All @@ -45,7 +49,7 @@ export interface QueryOpts<TGraphQLVariables = OperationVariables> {
pollInterval?: number;
client?: ApolloClient<any>;
notifyOnNetworkStatusChange?: boolean;
context?: Record<string, any>;
context?: Context;
partialRefetch?: boolean;
}

Expand Down
5 changes: 1 addition & 4 deletions src/walkTree.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as React from 'react';

export interface Context {
[key: string]: any;
}
import { Context } from './types';

interface PreactElement<P> {
attributes: P;
Expand Down