I’m just upgrading from nexus@0.3.x, am I correct ...
# orm-help
j
I’m just upgrading from nexus@0.3.x, am I correct that I now need to create all the types and input types manually?
d
Hi, James. Did you figure out how to do this regarding the input types? I’m also upgrading from an old 0.3.8 app (along with an upgrade to Prisma 2). To create a custom mutation I used to do this:
Copy code
t.field('createProduct', {
  ...t.prismaType.createProduct,
  resolve: async (
    _,
    {
      data: {
        // ...
      }
    },
    ctx: Context
  ) => {
    // ...
  }
The spreading of
t.prismaType.createProduct
gave me the inputs I required. For the non-input types, I just used this: https://github.com/AhmedElywa/create-nexus-type#readme
j
🙏 1
Hi Darryl, this kinda shows what I ended up doing. The
t.prismaType
thing is gone now so I used the
arg()
helper. Nexus then complained about missing types but I found that by exposing the default
crud
operation that error went away and I overrode the default name of the mutation
d
Hi, James. Ah, okay. Makes sense. Thank you! I’ll give it a go tomorrow. 👍
That seems to have worked. Thank you, James! Out of interest, did you just figure this out yourself or was it in some documentation? I asked one of the guys working on nexus why I couldn’t do something similar to the
…t.prismaType.createProduct
to get all args from an auto-generated CRUD operation and the answer was just because it doesn’t work now and they don’t have a better solution yet.