Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
Empty show more show less
-
Yes
-
HL & LD 24
-
3
Description
Steps to reproduce
- With "beta-2" - Use GraphiQL(attached as file) to submit a simple query with no varialbes, like:
{
books {
title
}
}
Expected results
The response.
Actual results
{
"status": 500,
"errors": [
"An internal server occurred, please check the log file"
]
}
Magnola log shows:
graphql.AssertException: variables map can't be null
at graphql.Assert.assertNotNull(Assert.java:15) ~[graphql-java-14.1.jar:?]
at graphql.ExecutionInput$Builder.variables(ExecutionInput.java:243) ~[graphql-java-14.1.jar:?]
at info.magnolia.graphql.core.http.GraphQLServlet.handleQuery(GraphQLServlet.java:95) ~[magnolia-graphql-core-1.0-beta2.jar:?]
at info.magnolia.graphql.core.http.GraphQLServlet.doGet(GraphQLServlet.java:78) [magnolia-graphql-core-1.0-beta2.jar:?]
Workaround
In the "Query Variables" pane of GraphiQL, supply an empty object
{}
Notes
GraphiQL is a very popular GUI for graphQL endpoints. It should work by default.
I guess other GUI or usages will also stumble on this.
If it does not cause problems, I suggest that we treat non-existing or null query varaibles as an empty map so that the query succeeds.
Notes
Run the attached simple-graphiql.html file on any web server. (Needs to run on a web server due to Magnolia CORS)
Tweak the URL in the file to hit your instances graphql endpoint.
Checklists
Acceptance criteria
Attachments
Issue Links
- mentioned in
-
Page Loading...