Skip to content

Commit

Permalink
Expose correct types for contract (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
sslotsky authored Apr 8, 2020
1 parent 0b6c250 commit 383be1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/v0/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function wait(ms) {
}

export interface Gateway {
post: <Resp, Req extends {}>(path: string, body: Req) => Promise<Resp>;
post: <Resp, Req extends {}>(path: string, body: Req, init?: RequestInit) => Promise<Resp>;
}

export function createGateway({
Expand Down
5 changes: 4 additions & 1 deletion src/v0/graphqlFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export interface GraphqlResponseBody<GraphqlData> {
errors?: GraphqlError[];
}

export type GraphqlFetch = <T>(args: GraphqlRequest) => Promise<GraphqlResponseBody<T>>;
export type GraphqlFetch = <T>(
args: GraphqlRequest,
init?: RequestInit
) => Promise<GraphqlResponseBody<T>>;

export function createGraphqlFetch({
element,
Expand Down

0 comments on commit 383be1a

Please sign in to comment.