How make InputType flexible in GraphQL in node.js?
<p>My question is clear and simple about implementing GraphQL with Node.js.</p>

<p>There's two mutations. One is <code>createUser</code> and another is <code>updateUser</code>. Both mutations have argument <code>user</code> which is <code>UserInputType</code>.</p>

<pre><code>const UserInputType = new GraphQLInputObjectType({
  name: 'UserInputType',
  description: 'a user input type',
  fields: () =&gt; {
    return {
      username: {
        type: GraphQLString,
        description: 'a unique username for a user',
      },
      email: {
        type: GraphQLString,
        description: 'a unique email for a user',
      },
      password: {
        type: GraphQLString,
        description: 'a strong password for a user',
      },
    };
  },
});
</code></pre>

<p>The problem is, <code>createUser</code> mutation needs <strong>all parameters</strong> username, email and password.
<code>updateUser</code> needs just at least one parameter. Do I have to implement two <code>UserInputType</code>s for each mutation? I think that's not good way.</p>

<p>Hope a clue!</p>