我有这个错误
GraphQLError: Input Object type CreateUserInputDTO must define one or more fields.
at SchemaValidationContext.reportError
我已经尝试过一些建议,但是仍然不起作用
我不知道为什么会有这个错误,因为我有工作的另一个项目。我怀疑我可能使用了最新的模块?
这是代码
import {
Field,
InputType,
IntersectionType,
ObjectType,
OmitType,
} from '@nestjs/
当源代码从类型记录编译到javascript时,类型注释就会被删除,并且无法在运行时检查变量的类型。
但是,有许多类型记录库似乎根据类属性的类型注释来更改行为。例如,在编写typeorm实体时,我们可以编写如下内容:
@Entity()
class MyEntity extends BaseEntity {
@Field()
public id: number // automatically infers int database type
@Field()
public description: string // automatically infers varchar
我正在尝试将NestJS与typeorm一起使用。虽然我已经看了一些其他类似的问题,但这似乎是不同的,因为我在一个服务中使用了两个repos,我似乎看不到我做错了什么。 错误: Nest can't resolve dependencies of the AuthPhoneService (CredentialsRepository, ?, ConfigService). Please make sure that the argument Repository at index [1] is available in the AuthPhoneModule context. 我有一
我正在开发一个使用TypeORM和Postgres的NestJS登录系统。在我的登录选项中,我建议用户使用一对电子邮件/密码或使用OAuth身份验证。但一旦创建了帐户,它们就不是相互排斥的(例如,用户可以拥有一个电子邮件+密码和一个附加到其帐户的Google帐户)。
因此,我希望将密码或OAuthLogin设置为可空,但其中至少有一个永远不能为空。
有没有可能用TypeORM来实现这一点?
@Entity()
class User {
@PrimaryGeneratedColumn()
public id: number;
@Column({ unique: true
我在Oracle中使用GraphQL和Typeorm,并试图选择特定表中的所有数据。执行的查询是
SELECT "inventory"."id" AS "inventory_id", "inventory"."value" AS "inventory_value", "inventory"."description" AS "inventory_description" FROM "inventory" "inventory
嘿,嘿, 我试图建立一个使用NestJS + TypeORM的电子商务网站类型的后端。 我需要在我的order和products表之间建立一个m:n关系。因为我需要透视表中的一些自定义字段,所以我查阅了typeorms文档,正如上面所说的,我需要创建一个新的实体,我已经完成了。现在,我在启动NestJS应用程序时遇到错误: Error: Entity metadata for Product#productToOrders was not found. Check if you specified a correct entity object and if it's connect