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 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
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