Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringFieldUpdateOperationsInput should work without also "set" #147

Closed
DregondRahl opened this issue Nov 1, 2020 · 1 comment
Closed

Comments

@DregondRahl
Copy link

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,

@AhmedElywa
Copy link
Collaborator

We can't generate like Prisma.
Because Prisma generate TypeScript code, they can add many types for one field but in GraphQL, we can just add one type

More info will be in this issue #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants