Description
My project has a parameterized test where I pass an input graphql query file location and a response json file location as arguments, and use the DefaultGraphQlTester to validate test queries
This works great, except for the fact that my application has a couple of composite mutations where I create a parent and child object in the same request, and for those I'd really just like access to the entire json response document to check manually instead of having to give a path relative to the top level "data" path.
What we curerently have
graphQLTester.execute(document)
.path(relativePathFromDataNode)
.matchesJson(expectedJson);
What I would like
graphQLTester.execute(document)
.jsonBody()
.matchesJson(expectedJson);
Not picky about the syntax, I would just rather be able to compare a response like this:
{
"data": {
"createParent": {
... parent fields...
},
"createChild": {
... child fields ...
}
}
}
to a matching json document. Currently, I can supply '*' to the path argument in the first query, but that generates a list of nodes to match against
[
{
... parent fields...
},
{
... child fields...
}
]
which I feel is less intuitive than just allowing us access to the full json body when we need it. Thanks for your time and consideration, appreciate all the work you guys do.