So I have in my application a mutation that is mea...
# orm-help
g
So I have in my application a mutation that is meant to be able to create an Account with the option to connect or create Assets that are bound to that account. My mutation looks like:
createAccount(email: String!, company: String!, accountType: AccountType, assets: AssetCreateManyInput): Account
. This would be implemented in the same way as the
newUserWithPosts
mutation in the Prisma-Client blog post. But for some reason, the generated interface for AssetCreateManyInput looks like this:
Copy code
export interface AssetCreateManyInput {
    create: string;
    connect: string;
  }
Am I implementing this mutation wrong in my schema.graphql? Should I have a different type besides AssetCreateManyInput? I'm assuming that it would infer that type from the imported generated prisma.graphql
n
how are you generating that interface?
create
and
connect
should definitely not be of type
string
, that's a bug.
g
It's generated in
resolvers.ts
by resolver-codegen
n
What's the version you're on?
g
Version 0.3.0
n
Alright, that's the latest, and definitely a bug. Could you share a report/reproduction here: https://github.com/prisma/graphql-resolver-codegen/issues?
g
I certainly can. Am I defining my custom mutation the right way? Should the property assets be of type AssetCreateManyInput?
n
it already is.
and it's up to you how to type your custom mutation 🙂
using
assets: AssetCreateManyInput
is certainly a good idea.
g
Great, thank you 🙂
👌 1