Closed jfulse closed 3 years ago
Hey @jfulse !
I should be able to take a look at that relatively soon (within a couple days). Off the top of my head I don't see why we shouldn't be able to support that option. It actually sounds like a bug.
Hello,
That's great news, thank you!
Hi @jfulse,
Could you please try to use the ErgonoMockedProvider
instead of the one from apollo react?
import { ErgonoMockedProvider as MockedProvider } from "graphql-ergonomock";
You can find an example here: https://github.com/SurveyMonkey/graphql-ergonomock/blob/master/README.md#basic-example-apollo
if that doesn't work, please share a code snippet to show us how you used ergonomock
and apollo MockedProvider
together.
Hello!
I did try that but couldn't get it working. I'll work in a minimal reproduction (and maybe this exercise itself will indicate something incorrect in my setup..)
Apologies! It seems our backend has added custom scalar types without me realising it and these are causing the issue. I assume there's a way to mock custom scalars and will dig in and find out. @victor-guoyu
EDIT: So far I can't figure out how to handle custom scalars (beyond mocking each occurrence of such a field manually, which would be impractical). I've tried using both props mocks
and resolvers
. Have you come across this use case before?
@jfulse, thanks for the update and I don't think we have support for the custom scalar yet! I'll start working on it today and let you know when it's ready!
I'll start working on it today and let you know when it's ready!
Once again that's great news, thanks a lot!
👋 Hi, @jfulse, could you please update to the latest version
here is an example of how you can provide a default mock function for the custom scalar type.
It works with the latest version, thanks a lot for all the help and the new feature!
Hello and thanks for a great library!
I'm trying to use
ergonomock()
together with aMockedProvider
that usesaddTypename=true
. This doesn't work out of the box because the results fromergonomock()
only includes__typename
if the query does, and we would like to avoid adding it to the latter manually.Is there any chance of an
addTypename
option toergonomock
? If not do you have a suggestion for another solution?