Nexus: StringFieldUpdateOperationsInput should work without also "set"

Created on 1 Nov 2020  路  3Comments  路  Source: graphql-nexus/nexus

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,

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 :/

All 3 comments

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 :/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

capaj picture capaj  路  5Comments

MathiasKandelborg picture MathiasKandelborg  路  5Comments

tl-jarvis-prestidge picture tl-jarvis-prestidge  路  7Comments

antonbramsen picture antonbramsen  路  3Comments

tonyfromundefined picture tonyfromundefined  路  3Comments