From 383be1a31895265d57adf83239eeb4f0a027104d Mon Sep 17 00:00:00 2001 From: Sam Slotsky Date: Wed, 8 Apr 2020 11:37:56 -0500 Subject: [PATCH] Expose correct types for contract (#82) --- src/v0/gateway.ts | 2 +- src/v0/graphqlFetch.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/v0/gateway.ts b/src/v0/gateway.ts index 3c37a31..fb07404 100644 --- a/src/v0/gateway.ts +++ b/src/v0/gateway.ts @@ -5,7 +5,7 @@ function wait(ms) { } export interface Gateway { - post: (path: string, body: Req) => Promise; + post: (path: string, body: Req, init?: RequestInit) => Promise; } export function createGateway({ diff --git a/src/v0/graphqlFetch.ts b/src/v0/graphqlFetch.ts index 208a562..88308d3 100644 --- a/src/v0/graphqlFetch.ts +++ b/src/v0/graphqlFetch.ts @@ -60,7 +60,10 @@ export interface GraphqlResponseBody { errors?: GraphqlError[]; } -export type GraphqlFetch = (args: GraphqlRequest) => Promise>; +export type GraphqlFetch = ( + args: GraphqlRequest, + init?: RequestInit +) => Promise>; export function createGraphqlFetch({ element,