Ananth
Ananth

Reputation: 847

What is the difference between makeExecutableSchema & buildClientSchema in Apollo GraphQL

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

Upvotes: 1

Views: 607

Answers (1)

Marco Daniel
Marco Daniel

Reputation: 5765

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.

Upvotes: 1

Related Questions