Open soosap opened 5 years ago
This is a neat idea! I'm going to think about how we also might accomplish this more generally as part of a middleware.
Feels like mocking is outside of the concern of the library.
But, as @tgriesser said, the overall idea is interesting. Maybe just needs a cleaner implementation that piling on more props.
Using graphql-yoga we can pass a mocks object into
GraphQLServer
. This is kind of painful to manage this additional mocks object...... instead what I would prefer is something like authorize:
nexus could then generate a
mocks.js
file which we could import and pass to graphql-yoga'sGraphQLServer
. It would allow us to co-locate mock data with queries and mutations. What do you think about this idea :) ?