title: Use Graphql variables to define fields
body: <p>I am trying to do something effectively like this</p>
  
  <pre><code>`query GetAllUsers($fields: [String]) {
      users {
          ...$fields
      }
  }`
  </code></pre>
  
  <p>Where my client (currently Apollo for react) then passes in an array of fields in the variables section. The goal is to be able to pass in an array for what fields I want back, and that be interpolated to the appropriate graphql query. This currently returns a GraphQL Syntax error at $fields (expects a { but sees $ ). Is this even possible? Am I approaching this the wrong way?</p>
  
  <p>One other option I had considered was invoking a JavaScript function and passing that result to query(), where the function would do something like the following:</p>
  
  <pre><code>buildQuery(fields) {
      return gql`
          query {
                  users {
                      ${fields}
                  }   
          }`
  }
  </code></pre>
  
  <p>This however feels like an unecessary workaround.</p>