#Error: Cannot determine a GraphQL input type

3 messages · Page 1 of 1 (latest)

plain thicket
#

I'm having a problem with a defining an object type for a GraphQL field. For some reason, i'm getting the error "Error: Cannot determine a GraphQL input type ("BaseSchemeInfoDto") for the "images". Make sure your class is decorated with an appropriate decorator.", even though, i've already marked BaseSchemeInfoDto as a @ObjectType(). Any help would be appreciated.

harsh finch
#

Yes, ObjectType is for defining outputs, for inputs you need InputType (or ArgsType for the root level).
You could use mapped types to reuse existing types to create new ones, see https://docs.nestjs.com/graphql/mapped-types.
I don't think a single class can have both InputType and ObjectType decorators at the same time.

rapid trellis