When to use GraphQLID instead of GraphQLInt? : <p>It is not clear when to use <a href="http://graphql.org/docs/api-reference-type-system/#graphqlid" rel="noreferrer"><code>GraphQLID</code></a> instead of <a href="http://graphql.org/docs/api-reference-type-system/#graphqlint" rel="noreferrer"><code>GraphQLInt</code></a>.</p>

<p>Consider the following schema:</p>

<pre><code>type User {
  id: Int!
  firstName: String!
  lastName: String!
}

type Query {
  user (id: ID!): User
}
</code></pre>

<p>In case of <code>Query.user</code>, it seem to make no difference whether to use <code>GraphQLID</code> or <code>GraphQLInt</code>.</p>

<p>In case of <code>User.id</code>, using <code>GraphQLID</code> will cast the input to string. Using <code>GraphQLInt</code> will ensure that the input is an integer.</p>

<p>This makes the query and type system inconsistent.</p>

<p>The <a href="/questions/tagged/graphql-js" class="post-tag" title="show questions tagged &#39;graphql-js&#39;" rel="tag">graphql-js</a>  <a href="http://graphql.org/docs/api-reference-type-system/#graphqlid" rel="noreferrer">spec</a> simply says:</p>

<blockquote>
  <p>A <code>GraphQLScalarType</code> that represents an ID.</p>
</blockquote>

<p>Is this an implementation detail (e.g. should GraphQL client cast <code>GraphQLID</code> to an integer when it can), or is it expected that <code>ID</code> is always a string in <a href="/questions/tagged/graphql" class="post-tag" title="show questions tagged &#39;graphql&#39;" rel="tag">graphql</a>?</p>
