admin管理员组文章数量:1392059
- NEST js, TypeOrm, Graphql I don't have Idea why I'm having this error, doesn't exit any other type with the same name I need this form because. I'm using jsonb, for the data, this is the reason I have nested objects.
ERROR:
Waiting for the debugger to disconnect...
/Users/angelzapata/Desktop/Work/compass-backend/node_modules/graphql/type/schema.js:219
throw new Error(
^
Error: Schema must contain uniquely named types but contains multiple types named "activityInterface".
//#region Activity
@InterfaceType("activityInterface")
export abstract class ActivityInterface {
@Field(() => String)
name: string;
@Field(() => String, { nullable: true })
description?: string;
@Field(() => String)
type: ActivityType;
@Field(() => String)
picture_rule: ActivityRule;
// @Field(() => File, { nullable: true })
// picture?: File;
@Field()
comment_rule: ActivityRule;
@Field(() => String, { nullable: true })
comment?: string;
// @Field(() => ActivityForm)
// input_form: ActivityForm;
}
// Output
@ObjectType("activityOutput", { implements: ActivityInterface })
export class ActivityOutput implements ActivityInterface {
@Field(() => String)
name: string;
@Field(() => String, { nullable: true })
description?: string;
@Field(() => String)
type: ActivityType;
@Field(() => String)
picture_rule: ActivityRule;
// @Field(() => File, { nullable: true })
// picture?: File;
@Field()
comment_rule: ActivityRule;
@Field(() => String, { nullable: true })
comment?: string;
// @Field(() => ActivityFormOutput)
// input_form: ActivityFormOutput;
}
// Input
@InputType("activityInput")
export class ActivityInput implements ActivityInterface {
@IsNotEmpty()
@IsString()
@Field(() => String)
name: string;
@IsOptional()
@IsString()
@Field(() => String, { nullable: true })
description?: string;
@IsNotEmpty()
@IsEnum(ActivityType)
@Field(() => String)
type: ActivityType;
@IsNotEmpty()
@IsEnum(ActivityRule)
@Field(() => String)
picture_rule: ActivityRule;
// @IsOptional()
// @Field(() => File, { nullable: true })
// picture?: File;
@IsNotEmpty()
@IsEnum(ActivityRule)
@Field()
comment_rule: ActivityRule;
@IsOptional()
@IsString()
@Field({ nullable: true })
comment?: string;
// @ValidateNested()
// @Field(() => ActivityFormInput)
// input_form: ActivityFormInput;
}
//#endregion Activity
//#region ServiceTemplateSection
@InterfaceType("serviceTemplateSectionInterface")
export abstract class ServiceTemplateSection {
@Field(() => String)
name: string;
@Field(() => [ActivityInterface])
activities: ActivityInterface[];
}
// Output
@ObjectType("serviceTemplateSectionOutput", {
implements: ServiceTemplateSection,
})
export class ServiceTemplateSectionOutput implements ServiceTemplateSection {
@Field(() => String)
name: string;
@Field(() => [ActivityOutput])
activities: ActivityOutput[];
}
// Input
@InputType("serviceTemplateSectionInput")
export class ServiceTemplateSectionInput {
@IsNotEmpty()
@IsString()
@Field(() => String)
name: string;
// @ValidateNested({ each: true })
@Field(() => [ActivityInput])
activities: ActivityInput[];
}
//#endregion ServiceTemplateSection
I don't find any solution on internet, have anyone had the same problem? how did you resolve that?
本文标签:
版权声明:本文标题:graphql - Schema must contain uniquely named types but contains multiple types named "activityInterface" - Sta 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744783200a2624839.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论