Skip to content

graphql-multipart-request-spec is not followed fully #2409

@vsfedorenko

Description

@vsfedorenko

Summary

Hello, I am facing this issue. Please, check it first:
graphql-java-kickstart/graphql-java-servlet#260

Version
apollo-api-jvm:2.2.1

Description

I am getting the following exception:

java.lang.RuntimeException: expected null value when mapping variables.avatar
	at graphql.kickstart.servlet.core.internal.VariableMapper.mapVariable(VariableMapper.java:51) ~[graphql-java-servlet-9.2.0.jar:na]
	at graphql.kickstart.servlet.GraphQLMultipartInvocationInputParser.lambda$null$8(GraphQLMultipartInvocationInputParser.java:109) ~[graphql-java-servlet-9.2.0.jar:na]
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1510) ~[na:na]
	at graphql.kickstart.servlet.GraphQLMultipartInvocationInputParser.lambda$mapMultipartVariables$9(GraphQLMultipartInvocationInputParser.java:109) ~[graphql-java-servlet-9.2.0.jar:na]
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:723) ~[na:na]
	at graphql.kickstart.servlet.GraphQLMultipartInvocationInputParser.mapMultipartVariables(GraphQLMultipartInvocationInputParser.java:103) ~[graphql-java-servlet-9.2.0.jar:na]
	at graphql.kickstart.servlet.GraphQLMultipartInvocationInputParser.lambda$getGraphQLInvocationInput$2(GraphQLMultipartInvocationInputParser.java:77) ~[graphql-java-servlet-9.2.0.jar:na]
	at java.base/java.util.Optional.ifPresent(Optional.java:176) ~[na:na]
	at graphql.kickstart.servlet.GraphQLMultipartInvocationInputParser.getGraphQLInvocationInput(GraphQLMultipartInvocationInputParser.java:77) ~[graphql-java-servlet-9.2.0.jar:na]

This happens because during file upload you set the value to be equal mime type instead of setting it to be null like it is done in the spec: https://github.com/jaydenseric/graphql-multipart-request-spec.

I expect you to make it configurable or nullable. Also, this can be fixed at graphql-java-kickstart/graphql-java-servlet side, but technically, its you don't follow this spec, — not them: they expect it to be null as it must be. So, IMO, this should be fixed on your side first.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions