This message was deleted.
# help
s
This message was deleted.
b
I’ve not used the GraphQL extension yet, so I don’t know if it supports all the matchers that WireMock supports. In WireMock, there is a way to match on dates and times: https://wiremock.org/docs/request-matching/#dates-and-times My first question, though, would be: do you even need to match on the dates, too? Is just the ID not enough? It would make your mocks easier to write and maintain..
d
Thanks @Bas Dijkstra for the response. I was trying to do something like this but it didn't work. (variables":{"storesIds":[([-\w])+],"startDate":"([-\w])+","endDate":"([-\w])+") The thing is it looks for a exact match and doesn't match if the date has regex or any helpers in them.
b
Hmm.. As I said, I've not used the GraphQL extension myself. Do you really need to match on the dates?
d
The graphql URL and headers are similar for all the requests, the request varies on the Variables and the query, and for a particular query call the variables vary based on what is queried. So this week the start date and end date would be 10-dec-2023 & 16-Dec-2023, Next week it will be 17-Dec-2023 & 24-Dec-2023 and so on. https://oleg-nenashev.github.io/wiremock.org/docs/graphql-extension/docs/MatchStrategy/#queries
b
Yes, I see, but that wasn’t my question. Isn’t just matching on the store ID not enough? Do you need to supply different responses for the same store ID for different dates? If not you could just forget about the dates.
d
Yes the issue is with the request matching. If I ignore the dates then the matcher doesn't work.
b
OK. You'll have to ask someone who has experience with the GraphQL extension then.
269 Views