Is the intended way just to omit the part with `us...
# orm-help
j
Is the intended way just to omit the part with
user
in data? Can I do this dynamically? I’m reading all my queries from
.graphql
files, meaning in this case I could do a workaround with just another query called
CreateThingWithUser
, but that would not scale as it leads to a lot of duplication. I was also looking into directives but it seems those are only useful in defining what gets returned
Ah ok, now I got it resolved. If I use
UserWhereUniqueInput
as opposed to just ID, it works smoothly
Copy code
mutation CreateThing (
    $title: String!,
    $userWhere: UserWhereUniqueInput
) {
    createThing (
        data: {
            title: $title
            user: {
                connect: $userWhere
            }
        }
    ) {
        ...Thing
    }
}