Skip to content

Commit 4d10869

Browse files
authored
feat(typescript-graphql-request): export Sdk type (#3704)
1 parent cee1d75 commit 4d10869

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/plugins/typescript/graphql-request/src/visitor.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
103103
return {
104104
${allPossibleActions.join(',\n')}
105105
};
106-
}`;
106+
}
107+
export type Sdk = ReturnType<typeof getSdk>;`;
107108
}
108109
}

packages/plugins/typescript/graphql-request/tests/__snapshots__/graphql-request.spec.ts.snap

+3
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
284284
}
285285
};
286286
}
287+
export type Sdk = ReturnType<typeof getSdk>;
287288
async function test() {
288289
const client = new GraphQLClient('');
289290
const functionWrapper: SdkFunctionWrapper = async <T>(action: () => Promise<T>): Promise<T> => {
@@ -595,6 +596,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
595596
}
596597
};
597598
}
599+
export type Sdk = ReturnType<typeof getSdk>;
598600
async function test() {
599601
const client = new GraphQLClient('');
600602
const sdk = getSdk(client);
@@ -897,6 +899,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
897899
}
898900
};
899901
}
902+
export type Sdk = ReturnType<typeof getSdk>;
900903
async function test() {
901904
const client = new GraphQLClient('');
902905
const sdk = getSdk(client);

0 commit comments

Comments
 (0)