【发布时间】:2021-06-17 21:04:36
【问题描述】:
我在 React + Apollo 入门章节:https://www.howtographql.com/react-apollo/1-getting-started/
当我在 Prisma Playground 中输入以下查询时(如教程告诉我的那样):
mutation CreatePrismaLink {
post(
description: "Prisma gives you a powerful database toolkit ????"
url: "https://prisma.io"
) {
id
}
}
mutation CreateApolloLink {
post(
description: "The best GraphQL client for React"
url: "https://www.apollographql.com/docs/react/"
) {
id
}
}
我收到了我不理解的错误消息。好像是服务器的问题
"errors": [
{
"message": "Argument id for data.postedBy.connect.id must not be null. Please use undefined instead.\n",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"post"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"clientVersion": "2.12.1",
"stacktrace": [
"Error: Argument id for data.postedBy.connect.id must not be null. Please use undefined instead.",
"",
" at Document.validate (C:\\Users\\shanm\\hackernews-react-apollo\\server\\node_modules\\@prisma\\client\\runtime\\index.js:77413:19)",
" at NewPrismaClient._executeRequest (C:\\Users\\shanm\\hackernews-react-apollo\\server\\node_modules\\@prisma\\client\\runtime\\index.js:79065:17)",
" at C:\\Users\\shanm\\hackernews-react-apollo\\server\\node_modules\\@prisma\\client\\runtime\\index.js:79002:52",
" at AsyncResource.runInAsyncScope (async_hooks.js:197:9)",
" at NewPrismaClient._request (C:\\Users\\shanm\\hackernews-react-apollo\\server\\node_modules\\@prisma\\client\\runtime\\index.js:79002:25)",
" at Object.then (C:\\Users\\shanm\\hackernews-react-apollo\\server\\node_modules\\@prisma\\client\\runtime\\index.js:79119:39)",
" at processTicksAndRejections (internal/process/task_queues.js:93:5)"
]
}
}
}
],
"data": null
}
请帮我找出问题所在?
【问题讨论】:
标签: reactjs apollo react-apollo prisma