Skip to content

Commit

Permalink
fix core makeOperation types (#2665)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Sep 2, 2022
1 parent 9900596 commit 275a233
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-nails-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@urql/core': patch
---

Fix variable types in core makeOperation
11 changes: 9 additions & 2 deletions packages/core/src/utils/operation.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
import {
AnyVariables,
GraphQLRequest,
Operation,
OperationContext,
OperationType,
} from '../types';

function makeOperation<Data = any, Variables = object>(
function makeOperation<
Data = any,
Variables extends AnyVariables = AnyVariables
>(
kind: OperationType,
request: GraphQLRequest<Data, Variables>,
context: OperationContext
): Operation<Data, Variables>;

function makeOperation<Data = any, Variables = object>(
function makeOperation<
Data = any,
Variables extends AnyVariables = AnyVariables
>(
kind: OperationType,
request: Operation<Data, Variables>,
context?: OperationContext
Expand Down

0 comments on commit 275a233

Please sign in to comment.