tgriesser / cypress-graphql-mock

Adds commands for executing a mocked GraphQL server using only the client
171 stars 43 forks source link

Add support for batched & persisted queries. #10

Open DFurnes opened 5 years ago

DFurnes commented 5 years ago

This pull request adds support for apollo-link-batch-http and apollo-link-persisted-queries. If an array of queries is provided, it will resolve each one and then return the array of responses.

If the client tries to use persisted queries (which don't include the query itself in the payload), it will return a PersistedQueryNotSupported error so that the request is retried as a standard query.

DFurnes commented 5 years ago

If anyone wants to test this out, I’ve pushed a corresponding branch with the build directory included:

"cypress-graphql-mock": "DFurnes/cypress-graphql-mock#with-persisted-batch-support",
tgriesser commented 5 years ago

Hey @DFurnes - sorry for letting this sit for awhile. We now have proper cypress tests in this repo, so if you can just add a test for this feature & resolve the merge conflict, we can get it in there!

DFurnes commented 5 years ago

@tgriesser Rebased & added tests for each new feature in 1bfef61 and fa9b17f!

DFurnes commented 4 years ago

Hi @tgriesser, just wanted to check in & see if we can get this reviewed and merged in! 😃 Let me know if there's any other changes or documentation that'd be helpful.

kj-brown commented 2 years ago

Just going to bump this; hopefully it becomes available in the main repo!