Laily Sarvarian
10/12/2020, 5:40 PMmutation CreateComment($comment: String!, $caption: ID!,$gif:String,$imgs:[String!],$urls:[urlCommentData!]) {
createComment(
data: {
text: $comment
imgs:{
set:$imgs
}
urls:{
create:$urls
}
gif:$gif
user: { connect: { id: "ckg1dmbhk010707759dqhz5rq" } }
commentOn: { connect: { id: $caption } }
}
) {
id
text
user{
id
name
}
commentOn{
id
text
}
}
}
But I am getting this error:
”index.js:26 Uncaught (in promise) Error: Variable '$urls' cannot be non input type '[urlCommentData!]'. (line 1, column 97):
mutation CreateComment($comment: String!, $caption: ID!, $gif: String, $imgs: [String!], $urls: [urlCommentData!]) {“Ryan
10/13/2020, 9:11 AM# Write your query or mutation here
mutation {
createComment(
data: {
text: "ddadasd"
gif: "gif"
imgs: { set: ["image1", "image2"] }
urls: {
create: [
{ start: 1, end: 10, url: "url1", count: 10, kind: "url" }
{ start: 1, end: 10, url: "url2", count: 10, kind: "url" }
]
}
}
) {
text
imgs
urls {
id
}
}
}
I would suggest checking the inputs properly and see if they match what Prisma requires.