We are using slash graphql and I can write basic queries like:
query{
queryUser{
user{
username}
}
}
jsonData := `{
query:
{
queryUser {
username
}
}
}`
request, err := http.NewRequest("POST", "https://<GRAPHQL_API_HERE>", []byte(jsonData))
But I dont know how to write this kind of query.
mutation addAuthor($author: [AddAuthorInput!]!) {
addAuthor(input: $author) {
author {
id
name
}
}
}
Any help is appreciated?