menu

Elide

Elide is a java library built to make it easy to expose JPA beans as either a JSON API or a GraphQL webservice

Channels
Team

Is there a way to define a default filter expression that can be overwritten by…

August 22, 2019 at 8:11pm

Is there a way to define a default filter expression that can be overwritten by the user?

August 22, 2019 at 8:11pm

We have the problem that we are querying some large datasets containing all records since start of the application (~6 years now). For most users it would be enough to get only data of last year by default. Is there some way to define a default filter (like now() - 1 year) for a field that can be overridden by users?


August 22, 2019 at 8:19pm

I can think of three places where you could add an implicit filter. One is in a Jetty/JAX-RS filter. One is in a custom data store for the given entity. The final one would be a security check that examines the request scope. I would probably avoid the last one given changes that will likely happen in Elide 5. There is no convenient mechanism Elide provides to do something like this though.

Edited
  • reply
  • like