You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into issues by using graphql-upload together with type-graphql.
import { logger } from '@zeou/utils/logger'
import { sendToS3 } from '@zeou/utils/s3Client'
import GraphQlUpload from 'graphql-upload/GraphQLUpload.mjs'
import Upload from 'graphql-upload/Upload.mjs'
import { Arg, Mutation, Query } from 'type-graphql'
import { Image } from './Image.js'
export class FileResolver {
@Mutation(() => Image)
async uploadImage(
@Arg('file', () => GraphQlUpload)
{ createReadStream, filename }: Upload,
) {
const key = filename
try {
const result = await sendToS3({ key, body: createReadStream() })
logger.info(result)
} catch (error) {
logger.error((error as Error).message)
}
}
}
With this code on the console i got the following errors.
CannotDetermineGraphQLTypeError: Cannot determine GraphQL input type for argument named 'file' of 'uploadImage' of 'FileResolver' class. Is the value, that is used as its TS type or explicit type, decorated with a proper decorator or is it a proper input value?
type-graphql is doing type instanceof GraphQLScalarType check. Please ensure you have a single graphql instance in your node_modules. Maybe graphql-upload is using it's own graphql@16.
Hey There,
first of all thanks for this awesome library.
I'm running into issues by using graphql-upload together with type-graphql.
With this code on the console i got the following errors.
All with this tsconfig.json
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: