realm / realm-graphql-service

GraphQL service for Realm Object Server
https://realm.io
Apache License 2.0
43 stars 10 forks source link

Add support for filter/skip/limit/etc arguments of children fields #31

Open eliedrian opened 6 years ago

eliedrian commented 6 years ago

Title says it all.

http://graphql.org/learn/schema/#arguments tells me it's possible 😃

nirinchev commented 6 years ago

By children fields, do you mean collection properties (to many relationship)? So you can have something like:

query {
  companies {
    companyId
    name
    address
    employees(query: "isActive = true", skip: 10, take: 10)
  }
}
eliedrian commented 6 years ago

Exactly! And ofcourse

query {
  companies(query: "isActive = false") { # that is, inactive companies
    companyId
    name
    address
    employees(query: "isActive = true", skip: 10, take: 10) # but active employees
  }
}

should work as well

nirinchev commented 6 years ago

Sounds like a nice addition. I'll add it to our backlog, but in the meantime, we'd be happy to review a PR if you'd like to take a stab at it 🤓