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

Name conflict between 'filter' and 'where' #43

Open
ani-sha opened this issue Sep 25, 2020 · 3 comments
Open

Name conflict between 'filter' and 'where' #43

ani-sha opened this issue Sep 25, 2020 · 3 comments

Comments

@ani-sha
Copy link
Member

ani-sha commented Sep 25, 2020

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

We have been using filter in GraphQL CRUD Java and encountered this conflict, where and filter function the same.
where sounds more SQL specific, can be replaced with filter in GraphQL CRUD spec.

IMO, a delete should not require an input argument name, it should be filter.

type Mutation {
    deleteNote(input: MutateNoteInput!): Note
}

Suggested type defination:

type Mutation {
    deleteNote(filter: UpdateNoteFilter!): Note
}

cc: @wtrocki @machi1990 @rareddy

@machi1990
Copy link
Collaborator

IMO, a delete should not require an input argument name, it should be filter.

type Mutation {
    deleteNote(input: MutateNoteInput!): Note
}

Suggested type defination:

type Mutation {
    deleteNote(filter: UpdateNoteFilter!): Note
}

cc: @wtrocki @machi1990 @rareddy

+1. This makes total sense to me.

/cc @craicoverflow for additional insights.

@craicoverflow
Copy link

Makes sense to me also, input makes more sense when inserting data. I guess it was used because it is a mutation.

It would be great if you could copy this issue to https://github.com/graphqlcrud/spec, where it can be discussed in a wider context as there are other contributors who may be interested in this discussion.

@machi1990
Copy link
Collaborator

It would be great if you could copy this issue to https://github.com/graphqlcrud/spec, where it can be discussed in a wider context as there are other contributors who may be interested in this discussion.

+100.

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

3 participants