dfernandeza / graphql-mimic

Client side mocking library for GraphQL.
4 stars 0 forks source link

Mocking resolvers #2

Open charlypoly opened 4 years ago

charlypoly commented 4 years ago

I like your idea to fallback to default data given the type. I would also propose:

Open questions:

dfernandeza commented 4 years ago

Hey @wittydeveloper,

I totally agree on adding the ability to configure resolved data according to a provided type, this is totally going to be a feature, I'm still trying to come out with a clear API for this though, any suggestion greatly appreciated.

Regarding you question:

How should be handle nullable field by default?

I was thinking maybe using resolvers for each field would help with this?

Thanks

charlypoly commented 4 years ago

@dfernandeza

any suggestion greatly appreciated.

I think that design-wise, Apollo 3 new TypePolicy is a good inspiration: https://www.apollographql.com/docs/react/v3.0-beta/caching/cache-configuration/#the-typepolicy-type

I was thinking maybe using resolvers for each field would help with this?

I was more thinking for the use-case when no resolvers exist (lorem ipsum, etc)