What's the correct way to format a response, and how would I go about it?
In example I see online, the response data is never nested inside a key with the mutation name
Here's the request
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
name
}
}
Which of these is the correct response format for GraphQL?
This is what mine looks like now.
${"data" => %{
"createUser" => %{
"id" => 1,
"name" => "Bob",
}
}}
This is what I see in some example online (and I think it looks a lot cleaner)
${"data" => %{
"id" => 1,
"name" => "Bob",
}}
Which of these is more idiomatic GraphQL? And if it's the second one, is there a way to get Absinthe to format the response this way?