Closed victor-guoyu closed 3 years ago
This looks good. Can you amend the README.md with the API changes?
I tried testing this with npm link
to see if it solves https://github.com/SurveyMonkey/graphql-ergonomock/issues/104. Unfortunately I run into an Could not find "client" in the context or passed in as an option
error. I tried making sure the relevant libraries are the same versions in my own repo and in graphql-ergonomock
; can you think of another reason why this might be?
@jfulse sorry for the late reply! I think that error usually occurs when the test component is not wrapped by the ApolloProvider
or the client
is actually missing.
I might able to help more if you can share a code snippet
:tada: This PR is included in version 1.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@jfulse sorry for the late reply! I think that error usually occurs when the test component is not wrapped by the ApolloProvider or the client is actually missing. I might able to help more if you can share a code snippet
I tested now with version 1.2.0 instead of npm link and it works, with custom scalars and everything. Thank you so much for all the help and the new feature!
Issue: https://github.com/SurveyMonkey/graphql-ergonomock/issues/104
Allows users to provide default mock resolver.
In the case of custom scalar types, we only need to provide a default mock resolver function at the mock provider level and all the occurrences within the query should automatically using the value provided by the mock resolver.
example test case