Closed brocklj closed 2 weeks ago
After upgrading from version 4.2.0 to 4.3.0. When I try running cloud code function using GraphQL mutation with input type File.
4.2.0
4.3.0
{ "errors": [ { "message": "Variable \"$input\" got invalid value { resolve: [function], reject: [function], promise: {}, file: { filename: \"ff.jpg\", mimetype: \"image/jpeg\", encoding: \"7bit\", createReadStream: [function createReadStream] } } at \"input[0]\"; Expected type \"File\". [object Object] is not a valid File", "locations": [ { "line": 1, "column": 30 } ], "extensions": { "code": "BAD_USER_INPUT", "exception": { "stacktrace": [ "Error: [object Object] is not a valid File", " at GraphQLScalarType.parseFileValue [as parseValue] (/Users/jakub/development/prins/miwa/dash-api/node_modules/parse-server/lib/GraphQL/loaders/defaultGraphQLTypes.js:318:9)", " at coerceInputValueImpl (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:129:26)", " at /Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:74:16", " at from (<anonymous>)", " at coerceInputValueImpl (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:72:37)", " at coerceInputValue (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:39:10)", " at _loop (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/values.js:109:69)", " at coerceVariableValues (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/values.js:121:16)", " at getVariableValues (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/values.js:50:19)", " at buildExecutionContext (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/execute.js:205:61)", " at executeImpl (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/execute.js:103:20)", " at Object.execute (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/execute.js:62:35)", " at /Users/jakub/development/prins/miwa/dash-api/node_modules/apollo-server-core/dist/requestPipeline.js:261:48", " at Generator.next (<anonymous>)", " at /Users/jakub/development/prins/miwa/dash-api/node_modules/apollo-server-core/dist/requestPipeline.js:8:71", " at new Promise (<anonymous>)" ] } } } ] }
Create input mutation with method in Cloud code. Try upload type File.
Error occurs. Cannot pass Grapql type validations.
Proceeding to cloud code, with File type.
Server
Linux
Database
Postgres
I creates PR with a possible fix of this issue https://github.com/parse-community/parse-server/pull/7683
@mtrezza i believe it's fixed now ? old version and no more on yoga
New Issue Checklist
Issue Description
After upgrading from version
4.2.0
to4.3.0
. When I try running cloud code function using GraphQL mutation with input type File.{ "errors": [ { "message": "Variable \"$input\" got invalid value { resolve: [function], reject: [function], promise: {}, file: { filename: \"ff.jpg\", mimetype: \"image/jpeg\", encoding: \"7bit\", createReadStream: [function createReadStream] } } at \"input[0]\"; Expected type \"File\". [object Object] is not a valid File", "locations": [ { "line": 1, "column": 30 } ], "extensions": { "code": "BAD_USER_INPUT", "exception": { "stacktrace": [ "Error: [object Object] is not a valid File", " at GraphQLScalarType.parseFileValue [as parseValue] (/Users/jakub/development/prins/miwa/dash-api/node_modules/parse-server/lib/GraphQL/loaders/defaultGraphQLTypes.js:318:9)", " at coerceInputValueImpl (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:129:26)", " at /Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:74:16", " at from (<anonymous>)", " at coerceInputValueImpl (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:72:37)", " at coerceInputValue (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/utilities/coerceInputValue.js:39:10)", " at _loop (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/values.js:109:69)", " at coerceVariableValues (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/values.js:121:16)", " at getVariableValues (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/values.js:50:19)", " at buildExecutionContext (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/execute.js:205:61)", " at executeImpl (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/execute.js:103:20)", " at Object.execute (/Users/jakub/development/prins/miwa/dash-api/node_modules/graphql/execution/execute.js:62:35)", " at /Users/jakub/development/prins/miwa/dash-api/node_modules/apollo-server-core/dist/requestPipeline.js:261:48", " at Generator.next (<anonymous>)", " at /Users/jakub/development/prins/miwa/dash-api/node_modules/apollo-server-core/dist/requestPipeline.js:8:71", " at new Promise (<anonymous>)" ] } } } ] }
Steps to reproduce
Create input mutation with method in Cloud code. Try upload type File.
Actual Outcome
Error occurs. Cannot pass Grapql type validations.
Expected Outcome
Proceeding to cloud code, with File type.
Environment
4.3.0
Server
4.3.0
Linux
Database
Postgres
Logs