title: How to do a nested mutation resolver with nexus-prisma
body: <p>I have the following datamodel:</p>
  
  <pre><code>type Job { 
      // ...
      example: String
      selections: [Selection!]
      // ...
  }
  
  type Selection { 
      ...
      question: String
      ...
  }
  </code></pre>
  
  <p>I define my object type so:</p>
  
  <pre><code>export const Job = prismaObjectType({
    name: 'Job',
    definition(t) {
      t.prismaFields([
        // ...
        'example',
        {
          name: 'selections',
        },
        // ...
      ])
    },
  })
  </code></pre>
  
  <p>I do my resolver this way:</p>
  
  <pre><code>t.field('createJob', {
    type: 'Job',
    args: {
      // ...
      example: stringArg(),
      selections: stringArg(),
      // ...
    },
    resolve: (parent, {
      example,
      selections
    }, ctx) =&gt; {
      // The resolver where I do a ctx.prisma.createJob and connect/create with example
    },
  })
  </code></pre>
  
  <p>So now in the resolver I can receive the selections as json string and then parse it and connect/create with the job.</p>
  
  <p>The mutation would look like this:</p>
  
  <pre><code>mutation {
    createJob(
      example: "bla"
      selections: "ESCAPED JSON HERE"
    ){
      id
    }
  }
  </code></pre>
  
  <p>I was wondering if there's anything more elegant where I could do something like:</p>
  
  <pre><code>mutation {
    createJob(
      example: "bla"
      selections: {
         question: "bla"
      }
    ){
      id
    }
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>mutation {
    createJob(
      example: "bla"
      selections(data: {
        // ...
      })
    ){
      id
    }
  }
  </code></pre>
  
  <p>I've noticed that with <a href="https://github.com/prisma/nexus" rel="nofollow noreferrer">nexus-prisma</a> you can do <code>stringArg({list: true})</code> but you can't really do objects. </p>
  
  <p>My main question is what is the most elegant way to do either nested mutation or connect all in one.</p>