-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map deserialization inside objects #25
Comments
I believe we had the same issue and fixed it by setting: |
This will indeed change the way maps are treated, and will solve the immediate issue. Maps will be treated as complex scalar values (i.e. JSON blobs) and not transformed into lists of key-value pairs. But this means subselection is not possible (scalars are leaf types)... |
@mjp91 @brettcooper @bpoussin |
@kaqqao we've got by treating them as scalars, would be nice to have the extra type safety and sub-selection but not a must |
@kaqqao MapScalarStrategy() seems to serve our needs for the time being. |
Worth to note, maps are now treated as scalars by default, so the |
I solved the this JSON parse issue by replacing "Map<String, String> request" with "Map<String, Object> request" @PostMapping(value = "/graphql", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public Map<String, Object> graphql(@RequestBody Map<String, Object> request, HttpServletRequest raw) {
ExecutionResult executionResult = graphQL.execute(ExecutionInput.newExecutionInput()
.query(request.get("query").toString())
.operationName(request.get("operationName") != null ? request.get("operationName").toString() : null)
.context(raw)
.build());
return executionResult.toSpecification();
} |
As mentioned in gitter:
Exception raised when trying to pass in a Map via a mutation:
The text was updated successfully, but these errors were encountered: