Making plain ruby objects queryable with ruby-queryable
Mar 21, 2020 · 1 min read · #ruby · #tools poc
I recently open-sourced an experimental project of mine called ruby-queryable. This project allows for plain Ruby objects to become queryable, incorporating ideas from both GraphQL and .NET’s LinQ and IQueryable
All you have to do is wrap your object in a Queryable and you can begin querying it like this:
queryable = Queryable.new(User.new)
queryable.query {
name
email
peeps {
name
}
posts(limit: 10) {
name
}
}
Interested in trying it out? Feel free to check out the code here.
enjoyed this? there's 21 years more where that came from
More writing →