I am working with faunadb and it allows me to upload a .gql file and rest is handeled by faunadb,
my app is a todo list app, so I made the scheema for type Todo that can also contain array of Todo type,
but when I use mutation createTodo like
mutation(
$todo: String!,
$description: String!,
$status: Boolean!,
$date: String!,
$id: ID!,
$priority: Priority,
$subtodos: [Todo!],
$comments: [String!],
$reminders: [String!]
) {
createTodo(data: {
todo: $todo,
description: $description,
status: $status,
date: $date,
uid: $id,
priority: $priority,
subtodos: $subtodos,
comments: $comments,
reminders: $reminders
}) {
todo
date
status
_id
}
}
And my graphql schema is
enum Priority {
P1
P2
P3
P4
}
type Todo {
todo: String!
description: String!
status: Boolean!
date: String!
priority: Priority
uid: ID!
subtodos: [Todo!]
comments: [String!]
reminders: [String!]
}
type Query {
allTodos: [Todo!]!
}
and error I am reciving is
Variable '$subtodos' cannot be non input type '[Todo!]'. (line 9, column 20):
" +
' $subtodos: [Todo!],
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…