-
-
Notifications
You must be signed in to change notification settings - Fork 833
Description
Is your feature request related to a problem? Please describe.
I'm using @graphql-tools/[email protected] package with [email protected]. And I have code similar to this:
const wrappedSchema = wrapSchema({
schema,
transforms: [
new RenameTypes(name => {
// ...
}),
],
})The schema has the Upload scalar from the graphql-upload package. When I run my code I have the following error: Error: ‘Upload’ scalar serialization unsupported.. The serialize method is called by the wrapSchema function.
Please see the links:
-
return transformInputValue(type, value, (t, v) => t.serialize(v)); -
const serializedValue = serializeInputValue(varType, variableValues[varName]);
Describe the solution you'd like
Is it possible to avoid calling the serialize method when using the wrapSchema function? Or is there another solution?
Describe alternatives you've considered
I defined my own version of the Upload scalar:
const GraphQLUpload = new GraphQLScalarType({
name: 'Upload',
description: 'The `Upload` scalar type represents a file upload.',
parseValue: (value: any) => value,
parseLiteral () {
throw new Error('‘Upload’ scalar literal unsupported.')
},
serialize (value) {
return value
},
})This solved the error, but it doesn't seem safe
Additional context
My Node.js version is v14.16.0 and I'm using Ubuntu 20.04