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
Intended outcome:
Use components at storybook, mocking a response for a mutation based on dynamic variables (e.g: using HoC that updates the variables and refetch the mutation)
Actual outcome:
Was throwing an error like no mocked responses for the query
How to reproduce the issue:
Creating a component with MockedProvider and using dynamic values as variables, such as: https://codesandbox.io/s/w27mz5r44w
Version
apollo-boost@0.1.16
react-apollo@2.1.11
Maybe, creating some kind of dynamicVariables inside the mocks array for mockedProvider would be a nice way to help these cases, as PR 2467
The text was updated successfully, but these errors were encountered:
it would be nice if request could be a function (similar to how response can be). if it returns "true" then we return the response, else we look for other mocks. I need to dig up how the code currently works, but I see:
Any updates on this? This would be a very pleasant feature to have!
My Usecase is storybook: I have a form in storybook and that form triggers a mutation. Right now, I have to exactly match the contents of the form to the mock to make this work. It would be very cool if I could just accept any variables and return them in the response - kind of like an echo server.
Thanks in advance! :)
(I don't quite know who to tag here unfortunately :/)
Previosly created on react-apollo issue #2466
Intended outcome:
Use components at storybook, mocking a response for a mutation based on dynamic variables (e.g: using HoC that updates the variables and refetch the mutation)
Actual outcome:
Was throwing an error like
no mocked responses for the query
How to reproduce the issue:
Creating a component with
MockedProvider
and using dynamic values as variables, such as:https://codesandbox.io/s/w27mz5r44w
Version
Maybe, creating some kind of
dynamicVariables
inside the mocks array for mockedProvider would be a nice way to help these cases, as PR 2467The text was updated successfully, but these errors were encountered: