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

Changing the type on 'update' and 'delete' #44

Open
ani-sha opened this issue Sep 25, 2020 · 1 comment
Open

Changing the type on 'update' and 'delete' #44

ani-sha opened this issue Sep 25, 2020 · 1 comment

Comments

@ani-sha
Copy link
Member

ani-sha commented Sep 25, 2020

type Mutation {
  updateNote(input: MutateNoteInput!, where: UpdateNoteFilter): Note!
}

update or delete might return null in cases where it doesn't match the condition, also it can change a couple of rows instead of one. Suggested definition:

type Mutation {
 updateNote(input: MutateNoteInput!, filter: UpdateNoteFilter): [Note]
}

The same goes for delete.

cc: @rareddy @wtrocki @machi1990

@rareddy
Copy link
Collaborator

rareddy commented Sep 28, 2020

Actually, on delete I propose completely removing the Input and only have the filter like

type Mutation {
 deleteNote(filter: NoteFilterInput): [Note]
}

there is no need for input as the filter can present with ID to delete a single row or a filter to delete multiple rows. Moreover I like the return that is been done in Hasura like here https://hasura.io/docs/1.0/graphql/core/mutations/delete.html

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