Skip to content

Commit

Permalink
Merge pull request #38 from ForbesLindesay/patch-2
Browse files Browse the repository at this point in the history
fix: ensure variance of types matches how values are used
  • Loading branch information
dotansimha committed Sep 24, 2020
2 parents c35b2e8 + 6ee77c2 commit e3ac5b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { DocumentNode } from 'graphql';

export interface TypedDocumentNode<Result = { [key: string]: any }, Variables = { [key: string]: any }> extends DocumentNode {
__resultType?: Result;
__variablesType?: Variables;
/**
* This type is used to ensure that the variables you pass in to the query are assignable to Variables
* and that the Result is assignable to whatever you pass your result to. The method is never actually
* implemented, but the type is valid because we list it as optional
*/
__apiType?: (variables: Variables) => Result;
}

/**
Expand Down

0 comments on commit e3ac5b0

Please sign in to comment.