feroult / yawp

Kotlin/Java API framework for Google Appengine
http://yawp.io
MIT License
132 stars 20 forks source link

Add simple attribute filter to Index/Show Rest Actions #49

Open feroult opened 8 years ago

feroult commented 8 years ago

Imagina an Endpoint:

public class Person {
  @Id
  IdRef<Person> id;

  @Index
  String name;

  @Index
  IdRef<Address> addressId;
}

We can have an automatic API like this: /api/people?name=john.

Finally, if it is an IdRef attribute, we can convert it automatically: /api/people?addressId=10

Today it is possible to achieve those simple APIs with the aid of a Hook.

luanpotter commented 8 years ago

What about /api/people?q={w:['name, '=', 'John']}?

We can keep both, the new for simplicity and the current for completeness.

rsolci commented 8 years ago

@luanpotter this is getting close to what Facebook presented early this year with graphql: https://facebook.github.io/react/blog/2015/05/01/graphql-introduction.html

feroult commented 8 years ago

@luanpotter, agreed!