Testing GraphQL Services?
robodude666 opened this issue · 2 comments
robodude666 commented
I'm curious how you'd test a GraphQL service. For example, take the simple greeter service.
Sure, you could certainly call the actions and pass in params, but that wouldn't test the graphql definitions. To test that, would you need to add the ApolloService
mixin to your test broker and then use a graphql client? Or is there a simpler way?
icebob commented
I think you can test it with a simple request
lib which sends the GraphQL query as a REST request.
icebob commented
I've just added some integration test:
moleculer-apollo-server/test/integration/greeter.spec.js
Lines 111 to 128 in fe78b06