You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 11, 2025. It is now read-only.
Implementing complete GraphQL support involves reading the request body and considering it as the query for one special case. In a controller, this means using request.reader.text.
def index() {
def body = request.reader.text
respond body
}
In a test class the controller method is called multiple times as there are multiple tests.
This is a problem when the body is empty. When executing the second test, it fails with java.io.IOException: Stream closed. The tests are not independent.
Please note that when the body is not empty, i.e. request.json = [hello: "world"]
the tests pass.
Please also note that replacing request.reader.text with request.JSON in the controller causes the tests to pass. This is specifically for reading the body text.