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

New filter types #1

Open
dilab opened this issue Mar 12, 2017 · 2 comments
Open

New filter types #1

dilab opened this issue Mar 12, 2017 · 2 comments

Comments

@dilab
Copy link

dilab commented Mar 12, 2017

A FilterType that is similar to SortType:

It can handle single type filter, e.g.

filter: {name: category, value:{type: single,  look_for:cat_1  }}

It can handle multiple type filter, e.g.

filter: {name: categories, value:{type: multiple, look_for:{cat_1,cat_2} } }

It can handle range type filter, e.g.

filter: {name: created_date, value:{type: range, look_for{from:date_1, to:date_2 } } }

Does that make sense?

@viniychuk
Copy link
Member

It does, let's chat in gitter

@Leenzur
Copy link

Leenzur commented Nov 17, 2017

Hi everyone !
Firstly thanks for these amazing bundles of GraphQL.
I'm a GraphQL beginner and I'm searching the best way to use filters in GraphQL, and everytime found this at the moment on the web :

query getCustomers(
    $id: Int,
    $siren: String,
    $name: String,
    $email: String,
    $offset: Int,
    $limit: Int
  ) {
    customers(filter: {
        AND: [{
          id_contains: $id
        }, {
          siren_contains: $siren
        }, {
          name_contains: $name
        }, {
          email_contains: $email
        }]
      },
      offset: $offset,
      limit: $limit
    ) {
    id
    name
    siren
    email
  }
}

but I don't know if it's a general method or a graphcool's functionnality.
Please can you provide me some advices ? Thanks

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