Closed nullRefErr closed 2 years ago
What if the error is correct? Are you incorrectly putting a literal value where an Upload
scalar type is expected in your query?
Hmm, I'm not an expert in GraphQL, can you be more specific ? I was using firecamp to send request. I can share bit more if you want.
Found this in generated schema.graphql
"""The `Upload` scalar type represents a file upload."""
scalar Upload
Thanks a lot.
Edit: How can I find that I put literal value ?
Edit: I think I found the solution.
I was sending request like below from firecamp.
mutation Mutation {
uploadFile(upload: file)
}
Then I changed to this.
mutation Mutation($upload:Upload!) {
uploadFile(upload: $upload)
}
Now I can see the file name in the mutation function.
Solved.
I have the same problem with this error, help me please with more information
"errors": [
{
"message": "Upload serialization unsupported.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"singleUpload"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"message": "Upload serialization unsupported.",
"stacktrace": [
"GraphQLError: Upload serialization unsupported.",
" at GraphQLScalarType.serialize (/Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/node_modules/graphql-upload/public/GraphQLUpload.js:88:11)",
" at /Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/node_modules/@graphql-tools/delegate/dist/utils/src/transformInputValue.js:27:57",
" at transformInputValue (/Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/node_modules/@graphql-tools/delegate/dist/utils/src/transformInputValue.js:8:52)",
" at Object.serializeInputValue (/Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/node_modules/@graphql-tools/delegate/dist/utils/src/transformInputValue.js:27:12)",
" at /Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/dist/delegate/src/createRequest.js:59:37",
" at Array.forEach (<anonymous>)",
" at createRequest (/Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/dist/delegate/src/createRequest.js:55:29)",
" at createRequestFromInfo (/Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/dist/delegate/src/createRequest.js:13:12)",
" at Object.delegateToSchema (/Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/dist/delegate/src/delegateToSchema.js:12:21)",
" at /Users/omar-imac/Desktop/DesarrolloProyectos/1.-1Mentor/pilot-backend/dist/wrap/src/generateProxyingResolvers.js:64:47"
]
}
}
}
],
I'm using nestjs framework with graphql and got stuck when uploading a file.
This is the example
This is the error