https://linen.dev logo
Title
p

Preethu Kg

03/23/2023, 8:05 PM
Hey Everyone! I have been into service Virtualization for some years but just started using Wiremock. Looking forward to it.
🙌 1
u

Uri

03/23/2023, 9:01 PM
Welcome @Preethu Kg Let us know if we can help
p

Preethu Kg

03/24/2023, 4:04 AM
Hey! it would be great if I can get help with graphql mock service implementation using Wiremock. I have couple of operations and type of requests using graphql but when I try to do request validation using bodyPatterns it is not working. Basically when I take the same request from UI and unit test in postman it is working but not from UI
@Uri any reference?
u

Uri

03/25/2023, 3:51 PM
Hi WireMock does not support graphql at the moment - it is something that we already started working on adding in the near future
p

Preethu Kg

03/25/2023, 4:01 PM
Since it's application/json content type probably it should work similar way right? @Uri
Also, I am able to send response without adding any bodypattern check but once I add validations then it's not picking up
t

Tom

03/27/2023, 4:44 PM
Hey @Preethu Kg, you can technically serve GraphQL stubs with WireMock. The main limitation is that because GraphQL uses a non-standard JSON superset for request bodies the WireMock JSON parser can’t handle it, which means your only option for matching on it is string/regex comparisons, which can be brittle and hard to write correctly. We plan to add explicit support for the GraphQL request format which means that e.g. JSONPath expressions will work as a means of matching.
k

Kapish Malik

03/28/2023, 6:16 AM
Hey @Preethu Kg could you please help us with sample call which was not working. Curl ll work for reference.
p

Preethu Kg

03/28/2023, 8:09 AM
Hey! I added contains request validation and it seems working along with priority. Looks fine as of now
k

Kapish Malik

03/28/2023, 8:10 AM
We are planning to add support so it ll be helpful there so we don't miss out your usecase.