title: What is the point of naming queries and mutations in GraphQL?
body: <p>Pardon the naive question, but I've looked all over for the answer and all I've found is either vague or makes no sense to me. Take this example from the GraphQL spec:</p>
  
  <pre><code>query getZuckProfile($devicePicSize: Int) {
    user(id: 4) {
      id
      name
      profilePic(size: $devicePicSize)
    }
  }
  </code></pre>
  
  <p>What is the point of naming this query <code>getZuckProfile</code>? I've seen something about GraphQL documents containing multiple operations. Does naming queries affect the returned data somehow? I'd test this out myself, but I don't have a server and dataset I can easily play with to experiment. But it would be good if something in some document somewhere could clarify this--thus far all of the examples are super simple single queries, or are queries that are named but that don't explain why they are (other than "here's a cool thing you can do.") What benefits do I get from naming queries that I don't have when I send a single, anonymous query per request?</p>
  
  <p>Also, regarding mutations, I see in the spec:</p>
  
  <pre><code>mutation setName {
    setName(name: "Zuck") {
      newName
    }
  }
  </code></pre>
  
  <p>In this case, you're specifying <code>setName</code> twice. Why? I get that one of these is the field name of the mutation and is needed to match it to the back-end schema, but why not:</p>
  
  <pre><code>mutation {
    setName(name: "Zuck") {
  ...
  </code></pre>
  
  <p>What benefit do I get specifying the same name twice? I get that the first is likely arbitrary, but why isn't it noise? I have to be missing something obvious, but nothing I've found thus far has cleared it up for me.</p>