Golang with GraphQL
Requirements
Run
$ docker compose up
Generate
$ docker compose exec server go generate ./...
Example
Find todos
query findTodos {
todos {
id
text
done
user {
id
}
}
}
Create todo
mutation createTodo {
createTodo(input: { text: "todo1234", userId: "54321" }) {
id
user {
id
}
text
done
}
}
Update todo
mutation updateTodo {
updateTodo(
input: {
id: "af1310c4-0a86-47e6-8429-31bfeb7bda86"
text: "todo123456"
userId: "98765"
done: false
}
) {
id
text
done
}
}
Delete todo
mutation deleteTodo {
deleteTodo(input: { id: "af1310c4-0a86-47e6-8429-31bfeb7bda86" })
}