그래서, 내가 의견에 게시물에서 한 많은 관계가 있습니다GraphQL 오류 :에 알 수없는 인수 '삭제'필드 'removeFromPostsOnComments'
type Comments {
createdAt: DateTime!
deleted: Boolean
id: ID!
posts: Posts @relation(name: "PostsOnComments")
text: String!
updatedAt: DateTime!
user: String!
}
type Posts {
caption: String!
comments: [Comments!]! @relation(name: "PostsOnComments")
createdAt: DateTime!
displaysrc: String!
id: ID!
likes: Int
updatedAt: DateTime!
}
을하고 돌연변이를 실행하려면, 뿐만 아니라, 게시물과 댓글 사이의 연결을 삭제하는 등의 필드를 업데이트하려고 시도하는 '댓글에, true로, 삭제 :
mutation removeComment ($id: ID!, $cid: ID!, $stateB: Boolean) {
removeFromPostsOnComments (postsPostsId: $id, commentsCommentsId: $cid, deleted: $stateB){
postsPosts {
__typename
id
comments {
__typename
id
text
user
deleted
posts {
__typename
id
}
}
}
}
}
Query Variables
{
"id": "cj0qkl04vep8k0177tky596og",
"cid": "cj1de905k8ya201934l84c3id"
}
그러나 나는 다음과 같은 오류 메시지가 얻을 돌연변이 실행하면
으로
GraphQL error: Unknown argument 'deleted' on field 'removeFromPostsOnComments' of type 'Mutation'. (line 2, column 74):
removeFromPostsOnComments(postsPostsId: $id, commentsCommentsId: $cid, deleted: $stateB) {
updated 'deleted'필드를 모니터링하는 구독을 트리거하도록이 작업을 수행하고 싶습니다. 다음과 같이
생성 된 돌연변이의 출력은 다음과 같습니다
"data": null,
"errors": [
{
"message": "Unknown argument 'deleted' on field 'removeFromPostsOnComments' of type 'Mutation'. (line 2, column 77):\n removeFromPostsOnComments (postsPostsId: $id, commentsCommentsId: $cid, deleted: $stateB){\n ^",
"locations": [
{
"line": 2,
"column": 77
}
]
}
]
}
으로 이미지에서 볼 수 는, '삭제'확실히 '댓글'내 GraphCool 스키마에 포함되어
어떻게 돌연변이가 서버에 생겼는데? –
@ Locco0_0 돌연변이를 일으킨 결과물이 어떻게 생겼는지 궁금하다면 수정 된 질문을 참조하십시오. – TheoG
GraphQL 오류는 삭제 된 인수를 서버의 돌연변이에 추가하지 않았 음을 나타냅니다. –