Any tips for fixtures/mock data etc?
# random
a
Any tips for fixtures/mock data etc?
a
@Ash Berlin-Taylor use https://github.com/EasyGraphQL/easygraphql-tester it’ll mock/assert your queries/mutations/subscriptions, validate them against the schema, also you can pass fixtures, check if the used query is requesting a deprecated field and more… if you need any help with that just let me know!
a
I don't want to fully mock prisma though. If I have a endpoint in my app that does two queries (look up invite, look up org) and three mutations (create user, delete invite, add user to org) if I start to mock I have to build a delicate stack of mocks
And if I then make a change somewhere else (say in my type resolver that looks up messages) then I have to add a new mock in
a
@Ash Berlin-Taylor this package will mock everything for you, just set the schema and that’s it, you don’t have to create the mocks
a
That doesn't help when I need to test behavious in my app that depend on data being in certain states.
(Sorry, it's late here in the UK so I'm not explaining myself very well)
a
Also, you can set fixture
a
Hey, to resurrect this again (finally got back to this bit of the project): Unless I'm missing something this doesn't help when using the Prisma client
prisma.deleteUser(...)
etc