title: NodeJs GraphQL dynamic query variable
body: <p><a href="https://launchpad.graphql.com/9qvqz3v5r" rel="nofollow noreferrer">https://launchpad.graphql.com/9qvqz3v5r</a></p>
  
  <p>Here is my graphQL example </p>
  
  <p>If i passed userId:2 as static </p>
  
  <pre><code>{
    user(userId:2){
      firstName
      lastName
    }
  }
  </code></pre>
  
  <p>I will get output as below</p>
  
  <pre><code>{
    "data": {
      "user": {
        "firstName": "Joe",
        "lastName": "spin"
      }
    }
  }
  </code></pre>
  
  <p>I need same output using dynamic query variable </p>
  
  <pre><code>query getUserNameData($userId: User){
    user(userId:$userId){
      firstName
      lastName
    }
  }
  query variables
  {
    "userId" : 2
  }
  </code></pre>
  
  <p>But i am getter error as : 
  Variable \"$userId\" cannot be non-input type \"User
  <a href="http://prntscr.com/h2ojor" rel="nofollow noreferrer">http://prntscr.com/h2ojor</a></p>
  
  <p>Can anyone help me?</p>