Update requires "set:" for each input
input UserUpdateInput {
countPosts: IntFieldUpdateOperationsInput
email: StringFieldUpdateOperationsInput
id: StringFieldUpdateOperationsInput
name: NullableStringFieldUpdateOperationsInput
posts: PostUpdateManyWithoutAuthorInput
}
Create works without using "set:"
input UserCreateInput {
countPosts: Int
email: String!
id: String
name: String
posts: PostCreateManyWithoutAuthorInput
}
Primsa generates below, which makes it optional.
export type UserUpdateInput = {
id?: string | StringFieldUpdateOperationsInput
email?: string | StringFieldUpdateOperationsInput
name?: string | NullableStringFieldUpdateOperationsInput | null
countPosts?: number | IntFieldUpdateOperationsInput
posts?: PostUpdateManyWithoutAuthorInput
}
Can we generate it in a similar way?
Thanks,
another plugin was generating the schema again
Spoke with the plugin developer (paljs) it seems set: is required for all updates on nexus mutations because of the graphql limitation on types? is there a work around?
This also seems to happen with all FieldUpdateOperationsInput type (boolean, int, etc.)
It's really annoying and keeps from using the same input for a create and update in a single upsert :/
Most helpful comment
This also seems to happen with all FieldUpdateOperationsInput type (boolean, int, etc.)
It's really annoying and keeps from using the same input for a create and update in a single upsert :/