在我的graphql-yoga服务器中,我有这样一个模式:
type Play {
id: ID!
frames: [Frame!]!
}
type Frame {
id: ID!
play: Play!
}
query {
play(playId: "myid") {
id
### The error occurs when I uncomment these lines:
# frames {
# id
# }
}
}
我有用于查询的解析器:
return await context.prisma.p
我正在使用Prisma的Graphql服务器。但是当我尝试运行代码时,我得到了这个错误,我正在使用 const { GraphQLServer } = require('graphql-yoga')
const { prisma } = require('./generated/prisma-client') 这就是错误 Error: Directive constraint: Couldn't find type constraint in any of the schemas.
at collectDirective (D:\project\S
我现在的环境是prisma的图形瑜伽。当试图运行查询时,我会遇到“无法读取未定义的属性‘查询’”错误。我认为这是因为它不能从上下文中读取
这个问题发生在我重构代码和设置Prisma连接时。在启动服务器时,我已经将prisma包含在上下文中,但它似乎在任何地方都不可用。
错误
[nodemon] starting `babel-node src/index.js`
The server is up!
TypeError: Cannot read property 'query' of undefined
at Object.query (G:\laragon\www\en
我正在使用这个代码库中的代码:
但是,当我使用graphql playground测试服务器时,会话cookie并没有保存在我的浏览器上。换句话说,我向服务器发送了一个登录变异,尽管浏览器上没有保存cookie,但登录显然是有效的。
我在NodeJS上的ExpressJS上运行GraphQL瑜伽服务器。
如果您需要我添加任何其他信息,请告诉我。
非常感谢您的帮助!
index.ts
import { GraphQLServer } from "graphql-yoga";
import * as session from "express-session";
i
我正在尝试以下操作:
const CURRENT_USER_QUERY = gql`
query {
me {
id
email
name
permissions
cart {
id
quantity
item {
id
title
}
}
}
}
`
但我无法正确解析item字段。
下面是购物车解析器(它可以正确解析,但仅适用于具有标量返回值的字段:
async function cart(pa