Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Export Context type from types.ts instead of walkTree.ts.
When we stopped reexporting everything from walkTree.ts as part of #2533,
we also stopped exporting the Context type that it uses.

Moving the declaration and export of Context from walkTree.ts to types.ts
restores the ability to do

  import { Context } from "react-apollo"

which should fix #2824.
  • Loading branch information
benjamn committed Mar 1, 2019
commit 8bbf8e58d78c40ad8dd47d06e2a4a7a497061cad
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