diff --git a/packages/plugins/typescript/graphql-request/src/visitor.ts b/packages/plugins/typescript/graphql-request/src/visitor.ts index 8861092cf04..e1d75ea5216 100644 --- a/packages/plugins/typescript/graphql-request/src/visitor.ts +++ b/packages/plugins/typescript/graphql-request/src/visitor.ts @@ -103,6 +103,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = return { ${allPossibleActions.join(',\n')} }; -}`; +} +export type Sdk = ReturnType;`; } } diff --git a/packages/plugins/typescript/graphql-request/tests/__snapshots__/graphql-request.spec.ts.snap b/packages/plugins/typescript/graphql-request/tests/__snapshots__/graphql-request.spec.ts.snap index aa1feae3a4f..7b5c88ec9da 100644 --- a/packages/plugins/typescript/graphql-request/tests/__snapshots__/graphql-request.spec.ts.snap +++ b/packages/plugins/typescript/graphql-request/tests/__snapshots__/graphql-request.spec.ts.snap @@ -284,6 +284,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = } }; } +export type Sdk = ReturnType; async function test() { const client = new GraphQLClient(''); const functionWrapper: SdkFunctionWrapper = async (action: () => Promise): Promise => { @@ -595,6 +596,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = } }; } +export type Sdk = ReturnType; async function test() { const client = new GraphQLClient(''); const sdk = getSdk(client); @@ -897,6 +899,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = } }; } +export type Sdk = ReturnType; async function test() { const client = new GraphQLClient(''); const sdk = getSdk(client);