Vincit / objection-graphql

GraphQL schema generator for objection.js
MIT License
307 stars 34 forks source link

GraphQL query params and "OR" support #5

Closed nasushkov closed 7 years ago

nasushkov commented 7 years ago

Hi I am playing around this project for a while and I stuck with two problems right now:

  1. I want to use parameters for my queries, but they don't work for me for some reason. For instance, this query retrieves an empty set:
query getEnAirports($part:String){
  airports(iataLike: $part){
    id,
    name,    
    city,
    country,
    iata
  }
}

{
  "part": "%PE%"
}

while the same query with a hard coded value does the job:

query getEnAirports{
  airports(iataLike: "%PE%"){
    id,
    name,    
    city,
    country,
    iata
  }
}
  1. The second problem is "OR" support for queries. What's the right way to implement this? Should it be implemented as it is described in "Adding your own custom arguments" section with a custom suffix or there is another more convenient way?

Thanks.

koskimas commented 7 years ago

Parameters are not supported I'm afraid. I'm not aware of an easier way to do OR but to add custom args like iataLikeOr. Even then grouping won't be possible because there is no way to implement parentheses.

This project is not actively maintained at the moment. I'm the only developer and I've got my hands full with objection.js.

nasushkov commented 7 years ago

@koskimas Thanks for your reply. Ok, maybe I'll try to look at this by myself. BTW I like objection.js and I think it's the best Node.js ORM out there (well for my taste and needs) and also as GraphQL is gaining a great momentum now, this project is undeservedly abandoned.

koskimas commented 7 years ago

Yeah, there just isn't enough hours in a day...