我正在尝试为graphql字段创建角色守卫。如下所示:
import { Field, ObjectType } from 'type-graphql';
import { Column, Entity, JoinTable, ManyToMany, PrimaryGeneratedColumn } from 'typeorm';
import Role from '../role/role.entity';
@ObjectType()
@Entity()
class User {
@Field()
@PrimaryGenerate
我将@nest/graphql的版本从7.9.11更新到7.11.0,现在我有了以下错误:
src/app.module.ts:26:7 - error TS2345: Argument of type '{ path: string; autoSchemaFile: string; sortSchema: true; playground: boolean; }' is not assignable to parameter of type 'GqlModuleOptions'.
Object literal may only specify known
我开始用Nest构建我的第一个API。我正在尝试添加GraphQL,并且在非常简单的情况下得到了一个问题。
TypeError: graphql_1.parse is not a function
at Object.<anonymous> (C:\Users\marek\dev\eparafie\api-nest\node_modules\apollo-server-core\node_modules\graphql-tools\src\stitching\introspectSchema.ts:7:48)
at Module._compile (internal
我正在使用服务器上的、/GraphQL/ (内置于@nestjs/graphql)//PostgreSQL和客户机上的构建一个类型记录应用程序。
使用此堆栈(当对GraphQL使用代码优先方法时),您需要为每个实体提供以下模式(例如,“User”):
Prisma模型模式(用Prisma自己的Prisma schema语言编写),用于对数据库建模:
model User {
id Int @id @default(autoincrement())
name String
email String @unique
password String
createdAt
我在一个意想不到的位置看到了一些类验证器错误。我希望有一种更方便的格式来处理错误,但我可能不知道在扩展字段中处理对象的一些graphQL技巧……
在运行NestJS sample/23- GraphQL -code-first时,我在GraphQL操场上看到了以下内容:
使用输入:
addRecipe(newRecipeData: {
description: "too short"
title: "this field should fail for being too long"
ingredients: ["normal