profile
viewpoint

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

@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

@ObjectType('CompanyData')
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[];

}
MichalLytek/type-graphql

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

useful!
source:https://uonfu.com/
Github User Rank List