Exploring the possibility of using an array/list as a variable for a GraphQL mutation:
Schema
type User {
id: Id!
email: String
name: String
bookmarks: [Bookmark]
}
type Mutation {
updateUser(data: UserInput!): User
}
input UserInput {
email: String
name: String
bookmarks: [Bookmark]
}
type Bookmark {
vidId: String!
timestamp: Int!
}
Mutation
mutation($email: String, $name: String, $bookmarks: [{vidId: String!, timestamp: Int!}]) {
updateUser(data: {email: $email, name: $name, bookmarks: $bookmarks}) {
email
name
}
}
Encountering issues with the variable syntax in the mutation related to the bookmarks array. Seeking guidance on how to correctly pass an array as a GraphQL variable.