1

I'm trying to build a mocking infrastructure for our react client. Getting confused between the two.

Ananth
  • 837
  • 1
  • 10
  • 20

1 Answers1

1

buildClientSchema vs makeExecutableSchema

  • makeExecutableSchema can be used to mock schema types, resolvers, logger, etc...
  • buildClientSchema can only be used to mock the schema types, but cannot be used to execute queries/mutations.

If you want to mock and test the return (query) data use makeExecutableSchema if is just to test the schema type definitions use buildClientSchema.

It always comes into what you need to test.

yorch
  • 7,170
  • 8
  • 32
  • 38
Marco Daniel
  • 5,467
  • 5
  • 28
  • 36
  • Ahh got it, so a combination of `buildClientSchema` & `addMockFunctionsToSchema` would suffice in the client to achieve both mocking of schema tips and queries/mutations right? Thanks for the response @MarcoDaniels. – Ananth Jun 12 '18 at 04:51