Slackbot
08/29/2023, 12:14 PMOleg Nenashev
08/29/2023, 4:59 PMKrupa Mashruwala
09/05/2023, 1:44 PM"url": "/graphql",
"method": "POST",
"bodyPatterns": [
{
"matchesJsonPath": "$.query",
"contains": "query organisation($orgId: ID!) { organisation(organisationId: $orgId) { id name kvkNumber journeyTypeConfigurations { journeyType { id icon name } journeyReferenceType consumerRole infoMediationTemplateConfiguration { id type name } } } }"
},
{
"matchesJsonPath" : "$[?(@.variables.size() == 1)]"
},
{
"matchesJsonPath": {
"expression": "$.variables",
"equalToJson": "{ \"orgId\": \"36df60f7-033a-444f-846e-a7cde0fb3947\" }"
}
}
Negative scenario bodypattern:
"url": "/graphql",
"method": "POST",
"bodyPatterns": [
{
"matchesJsonPath": "$.query",
"contains": "query organisation($orgId: ID!) { organisation(organisationId: $orgId) { id name kvkNumber journeyTypeConfigurations { journeyType { id icon name } journeyReferenceType consumerRole infoMediationTemplateConfiguration { id type name } } } }"
},
{
"matchesJsonPath" : "$[?(@.variables.size() == 1)]"
},
{
"matchesJsonPath": "$.variables.orgId",
"doesNotEqual": "36df60f7-033a-444f-846e-a7cde0fb3947"
}
]
Now I am not getting why even when I pass correct value that matches for success scenario I get response from negative mapping only.
I am not sure if I answered your question correctly or not, but this is where we have used GraphQL mapping, along side documentation https://wiremock.org/docs/request-matching/ for request matching
let me know if I need to modify any places