Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typechecking of graphql data response doesn't work in versions >0.24.0 #555

Closed
lynxtaa opened this issue Jan 21, 2021 · 0 comments · Fixed by #587
Closed

Typechecking of graphql data response doesn't work in versions >0.24.0 #555

lynxtaa opened this issue Jan 21, 2021 · 0 comments · Fixed by #587
Labels
bug Something isn't working help wanted Extra attention is needed scope:typescript

Comments

@lynxtaa
Copy link

lynxtaa commented Jan 21, 2021

Describe the bug

Typechecking of graphql data response doesn't work in versions >0.24.0. See example below

Environment

  • msw: 0.25.0
  • nodejs: 15.6.0
  • npm: 7.4.1

To Reproduce

Consider this code in [email protected]:

interface GetUsers {
  users: { id: number; login: string }[]
}
// ...
server.use(
  graphql.query<GetUsers>('GetUsers', (req, res, ctx) => res(ctx.data({}))),
)

This will produce a typechecking error, which is expected:

Argument of type '{}' is not assignable to parameter of type 'GetUsers'.

In [email protected] I see no error in the above code.

Expected behavior

I expected to see a typechecking error in [email protected]

@lynxtaa lynxtaa added the bug Something isn't working label Jan 21, 2021
@kettanaito kettanaito added this to the GraphQL support milestone Jan 21, 2021
@kettanaito kettanaito added the help wanted Extra attention is needed label Feb 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed scope:typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants