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
using LocalGraphQLClient with passing localQueries for test purposes is not calling the middleware functions and causing the middleware not being tested completely
How to reproduce
Create a GraphQL client and pass a middleware dummy function
Use LocalGraphQLClient and define some localQueries to mock
Debug and observe the middleware function is not getting called
Suggested solution (optional)
The text was updated successfully, but these errors were encountered:
Another issue is that responseReducer isn't engaged either so the mocks should return the data in the shape the response reducer would have it, which could be used as a workaround if the shape of that data is an object. Otherwise it will be converted to an object. This code does it.
Steps to reproduce:
call useQuery with responseReducer that returns an array
create a mock which returns the same array as we expect after responseReducer is called
receive an object instead
I think it would be less painful and technically more correct if LocalGraphQLClient overrode requestViaHttp and requestViaWS instead of request.
Package
graphql-hooks
Environment
graphql-hooks
version: 6.4.0react
version: 17.0.2Description
using LocalGraphQLClient with passing localQueries for test purposes is not calling the middleware functions and causing the middleware not being tested completely
How to reproduce
Suggested solution (optional)
The text was updated successfully, but these errors were encountered: