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

Adding a query builder to Lokka #27

Open
imolorhe opened this issue Oct 26, 2016 · 9 comments
Open

Adding a query builder to Lokka #27

imolorhe opened this issue Oct 26, 2016 · 9 comments

Comments

@imolorhe
Copy link

So I currently have an issue, or rather a feature request. I am beginning to have to work with queries with optional arguments that may not be provided in certain instances, but having created the query string, it isn't very flexible to remove arguments dynamically. Is there any proposed query builder tool to be used? Or could this be added to Lokka? I believe it would be a useful feature, given that scenarios where dynamically adding arguments would occur in a lot of projects.

@arunoda
Copy link
Contributor

arunoda commented Oct 26, 2016

@imolorhe
Copy link
Author

@arunoda Oh wow.. cool! Any documentation for that? And is that used internally in Lokka or where is it used?

@arunoda
Copy link
Contributor

arunoda commented Oct 26, 2016

Documentation is in the above repo itself. Isn't that useful.
Basically, it'll create a GraphQL query string.
So, you could use it with anything.

@imolorhe
Copy link
Author

@arunoda It doesn't seem to cover all the use cases, like using fragments and query variables.

@arunoda
Copy link
Contributor

arunoda commented Oct 26, 2016

Yeah! True.

@imolorhe
Copy link
Author

@arunoda But does it kinda handle those implicitly? Even though the examples aren't there in the README?

@arunoda
Copy link
Contributor

arunoda commented Oct 26, 2016

I need to ask this from @mnmtanish
Hey do we support fragments, I mean something like this:

{
  teamFourStar {
    members {
      ...memberFields
    }
}

@thani-sh
Copy link

Opened issues for fragments and query variables. I'll post an update when they are ready.

@adexphem
Copy link

Was with a colleague today and he came up with

actionCall(${ternary_operation} , ${ternary_operation}) {}

Usage:

let params = {
id: 12343
}

addTo(params){
let ADD_TO_QUERY = { addTo(${(params.cart_id) ?cart_id: ${params.cart_id},: ''}) { job_id job_info{ can_get_paid salary_range debt{ debt_id } } } } ;

    return ~~~~~~.mutate(ADD_TO_QUERY);
}

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

4 participants