Ask questionsCannot determine GraphQL input type for

throw new Error(Cannot determine GraphQL input type for ${typeOwnerName}`); ^

Error: Cannot determine GraphQL input type for company` having this error my resolver

export class CategoriesResolver {
  @Query(() => CategoriesData)
  async get_category_by_id(@Arg('company', type => CompanyData) company: CompanyData, @Arg('id') id: String): Promise<any> {
    let cat = new GetCategoryByIdLib()
    return cat.getCategoryById(company, id)

My Data Fields

export class CompanyData {

    @Field(type => ID)
    _id : String

    @Field(type => String, {nullable: true})
    name: String;

    @Field(type => String, {nullable: true})
    email: String;

    @Field(type => String, {nullable: true})
    api_key: String;

    @Field(type => DocumentsData, {nullable: true})
    document: DocumentsData;

    @Field(type => [String], {nullable: true})
    phones: String[];

    @Field(type => AddressData, {nullable: true})
    address: AddressData;

    @Field(type => ImagesData, {nullable: true})
    avatar: ImagesData;

    @Field(type => [CustomerData], {nullable: true})
    customers: CustomerData[];


Answer questions iamlothian

For future readers

This may have been due to using an @ObjectType() CompanyData as an @InputType() in the resolver.

See docs for: inputType

Github User Rank List