Prisma 的编译器错误

Posted

技术标签:

【中文标题】Prisma 的编译器错误【英文标题】:Compiler error with Prisma 【发布时间】:2019-01-25 09:58:34 【问题描述】:

我正在准备一个带有GraphQL服务器的项目,使用Prisma连接数据库,这一切都使用Typscript

编译器正在返回我:

错误:哎呀。看起来像内部服务器错误。在服务器日志中搜索请求 ID:local:management:cjkzo60s4000e0a01tuoln3l4: "response":"data":"deploy":null,"errors":["message":"哎呀。看起来像一个内部服务器错误。在服务器日志中搜索请求 ID:local:management:cjkzo60s4000e0a01tuoln3l4","path":["deploy"],"locations":["line":2,"column":9],"requestId" :"local:management:cjkzo60s4000e0a01tuoln3l4"],"status":200,"request":"query":" mutation($name: String!, $stage: String! $types: String! $dryRun: Boolean $secrets: [String!], $subscriptions: [FunctionInput!], $force: Boolean) \n deploy(input: \n name: $name\n stage: $stage\n types: $types\n dryRun : $dryRun\n 秘密: $secrets\n 订阅: $subscriptions\n 强制: $force\n ) \n 错误 \n 类型\n 字段\n 描述\n \n 警告 \n 类型\ n 字段\n 描述\n \n migration \n ...MigrationFragment\n \n \n \n \nfragment MigrationFragment on Migration \n revision\n steps \n type\n __typename\n ... on CreateEnum \n name\ n ce_values: values\n \n ... on CreateField \n model\n name\n cf_typeName: typeName\n cf_isRequired: isRequired\n cf_isList: isList\n cf_isUnique: 唯一\n cf_relation: 关系\n cf_defaultValue:默认\n cf_enum: enum\n \n ... 在 CreateModel \n 名称\n \n ... 在 CreateRelation \n 名称\n leftModel\n rightModel\n \n ... 在 DeleteEnum \n 名称\n \n ... 在 DeleteField \n 模型\n 名称\n \n ... 在 DeleteModel \n 名称\n \n ... 在 DeleteRelation \n 名称\ n \n ... 在 UpdateEnum \n name\n newName\n values\n \n ... on UpdateField \n model\n name\n newName\n typeName\n isRe quired\n isList\n isUnique: 唯一\n 关系\n 默认\n 枚举\n \n ... 在 UpdateModel \n name\n um_newName: newName\n \n \n\n\n ","variables":"name":"default","stage":"default","types":"enum UserType \n CUSTOMER\n MAKER\n ADMIN\n\n\n\nenum OfferType \n NORMAL\n LTS\n\n\n\nenum DesignType \n MUSIC\n GRAPHIC_ART\n PIXEL_ART\n MOTION_DESIGN\n\n\nenum StoryType \n SMALL\n LONG\n\n \ninterface Account \n id: ID! @unique\n 已注册:布尔值! @default(value: \"false\")\n 联系人:[帐户!]!\n 地址:地址\n 收藏夹:[服务!]!\n\n\n输入地址 \n id:ID! @unique\n city: String!\n country: String!\n street: String\n houseNumber: String\n phoneNumber: String\n\n\ntype User implements Account \n id: ID! @unique\n 已注册:布尔值! @default(value: \"false\")\n 联系人:[Account!]!\n 地址:Address\n 收藏夹:[Service!]!\n 性别:Gender\n personalData:PersonalData\n 类型:UserType\ n\n\n输入个人数据 \n id: ID! @unique\n firstName: String\n lastName: String!\n email: String!\n\n\ntype 组织实施 Account \n id: ID! @unique\n 已注册:布尔值! @default(value: \"false\")\n 联系人:[Account!]!\n 地址:Address\n 收藏:[Service!]!\n 负责人:User\n\n\ntype Payment \n身份证:身份证! @unique\n date: DateTime!\n price: Int!\n\n\ntype Purchase \n id: ID! @unique\n payment:Payment!\n 卖家:Account!\n 买家:Account!\n services:[Service!]!\n\n\ntype Offer \n price:Int!\n type:OfferType\ n\n\n接口服务\n id:ID! @unique\n creationDate: DateTime!\n updateDate: DateTime!\n cmets: [Comment!]!\n author: Account!\n offer: Offer\n\n\ntype Design implements Service \n id: ID ! @unique\n creationDate: DateTime!\n updateDate: DateTime!\n cmets: [Comment!]!\n author: Account!\n offer: Offer\n type: [DesignType!]!\n\n\ntype故事实现服务 \n id: ID! @unique\n creationDate: DateTime!\n updateDate: DateTime!\n cmets: [Comment!]!\n author: Account!\n offer: Offer\n endDate: DateTime!\n type: [StoryType!]!\ n\n\n输入评论 \n id: ID! @unique\n 作者:账号! @relation(name: \"Writer\")\n service: Service!\n\n\n","secrets":null,"subscriptions":[] 在 GraphQLClient。 (/usr/local/lib/node_modules/prisma/node_modules/graphql-request/src/index.ts:72:13) 在步骤(/usr/local/lib/node_modules/prisma/node_modules/graphql-request/dist/src/index.js:40:23) 在 Object.next (/usr/local/lib/node_modules/prisma/node_modules/graphql-request/dist/src/index.js:21:53) 完成时(/usr/local/lib/node_modules/prisma/node_modules/graphql-request/dist/src/index.js:12:58) 在 在 process._tickCallback (internal/process/next_tick.js:160:7)

希望你能看懂,也希望有人能帮帮我!

感谢您的阅读:)

【问题讨论】:

相关问题link 谢谢!通过了! 【参考方案1】:

此问题与 issue 有关,该issue 正在关闭。

祝大家今天愉快!

【讨论】:

以上是关于Prisma 的编译器错误的主要内容,如果未能解决你的问题,请参考以下文章

Prisma 嵌套创建引发未知 arg 错误,而 prisma 示例工作

运行 prisma migrate / generate 后 Prisma ECONNREFUSED 错误

使用 Express 处理 Prisma 错误

使用 Prisma 生成代码的变量错误

docker swarm deploy 上的 Prisma 配置错误

Prisma:错误:P1017 服务器已关闭连接