Does WireMock support Mocking GraphQL APIs

1.3k Views Asked by At

We have multiple micro services which is based on GrapQL and few of them based on REST and each micro service will call multiple other microservices (Java, Spring Boot tech stack). Now we want to write integration testing for this kind of orchestration.

We thought of using WireMock for Stubbing external Micro Services. But does it support GraphQL? As Wirmock will will support REST MS mocking can it be used for Stubbing GraphQL as well when using with Spring Boot?

1

There are 1 best solutions below

3
agoff On BEST ANSWER

Yes, WireMock supports GraphQL. WireMock allows request matching based on almost every bit of data sent in a network request (in the case of GraphQL, most likely the request body), and so you can set up WireMock to respond differently based on the information in the request body.