You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument of type '() => Response' is not assignable to parameter of type 'ResponseResolver<GraphQLResolverExtras<GraphQLVariables>, null, GraphQLResponseBody<Record<string, any>>>'.
Type 'Response' is not assignable to type 'AsyncResponseResolverReturnType<GraphQLResponseBody<Record<string, any>>>'.
Property '[bodyType]' is missing in type 'Response' but required in type 'StrictResponse<GraphQLResponseBody<Record<string, any>>>'.typescript(2345)
Can be worked around by casting the passthrough type:
Prerequisites
Environment check
msw
versionNode.js version
20.5.1
Reproduction repository
https://codesandbox.io/p/sandbox/msw-gql-passthrough-typeerror-jz9s6m?file=%2Fsrc%2Fmsw.ts
Reproduction steps
Open
msw.ts
. Observe TS errors.Current behavior
TypeScript error when trying to
return passthrough()
in a GraphQL handler.Can be worked around by casting the passthrough type:
Expected behavior
passthrough()
can be returned ingraphql
mocks, as it can inhttp
mocks.The text was updated successfully, but these errors were encountered: