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

How use @where directive to query by the same data on 3 differents field with orWhere clasule? #889

Closed
IgorDePaula opened this issue Jul 30, 2019 · 10 comments
Labels
question Request for support or clarification

Comments

@IgorDePaula
Copy link

Is your feature request related to a problem? Please describe.

Yes. I would like query the same data in 3 differents fields with OR Where clasule.
I tried this but not work
#831

Describe the solution you'd like

I would like query the same data in 3 differents fields with OR Where clasule.

Describe alternatives you've considered
I tried this but not work

donators(count: Int!, page: Int!, payment_form_id: [Int] @in(key:"payment_form_id"), donator_status_id: [Int]  @in(key:"donator_status_id"), donator_type_id: [Int]  @in(key:"donator_type_id"), shipping_method_id: [Int]  @in(key:"shipping_method_id"), full_name: String @where(operator: "like", clasule:"orWhere", key: "full_name") @where(operator: "like", clasule:"orWhere", key: "document") @where(operator: "like", clasule:"orWhere", key: "email")): [User!]!  @paginate(scopes:["donator"])
@IgorDePaula
Copy link
Author

Captura de tela de 2019-07-30 16-08-39

@milewski
Copy link

milewski commented Jul 31, 2019

@IgorDePaula wow I know you ... good old MSN time haha

I think the problem in your query is that you mistyped: clause with clasule :P

@IgorDePaula
Copy link
Author

@milewski that little world...haha

How I can write my where clasule? I need search the same data in 3 differents fields.

@milewski
Copy link

milewski commented Jul 31, 2019

@IgorDePaula I mean, did you try this:

-@where(operator: "like", clasule: "orWhere", key: "email")
+@where(operator: "like", clause: "orWhere", key: "email")

@IgorDePaula
Copy link
Author

I'll try.

@IgorDePaula
Copy link
Author

Captura de tela de 2019-07-31 10-28-36

=/ I need search the same information in 3 fields of table, but only search in one field, I need specify 3 fields search in schema?

@IgorDePaula
Copy link
Author

Captura de tela de 2019-07-31 10-34-46
Captura de tela de 2019-07-31 10-35-05

I change full_name to search field in schema.

I need search the same information in 3 fields: document, full_name and email.
It only search in document and full_name, but not in email field. =/

@IgorDePaula
Copy link
Author

How I detected that no search in document too, only full_name, the first clause. =/

@olivernybroe
Copy link
Collaborator

Look into the directive whereConstraints.

@olivernybroe
Copy link
Collaborator

This question looks more like it belongs on StackOverFlow or our Slack support.

@spawnia spawnia added the question Request for support or clarification label Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for support or clarification
Projects
None yet
Development

No branches or pull requests

4 participants