harvard-lil / capstone

CAP database scripts.
MIT License
188 stars 43 forks source link

Allow API queries to limit response data to certain fields? #1696

Closed jcushman closed 1 year ago

jcushman commented 3 years ago

We have a user request for the API to let you limit what fields are returned, I believe to make results in the API browser more readable.

If we want to add that, https://django-restql.yezyilomo.com/ could be a good library. It uses a graphql-inspired syntax to filter down result fields, like ?query={id} (only return the requested fields), ?query={id, cites{*}} (nested fields, wildcards), ?query={-cites} (excluded fields). Not sure if it'll just work or if it'll conflict with all the other fancy stuff we're doing to work with elasticsearch -- depends on how exactly it does what it does.

kilbergr commented 1 year ago

Not doing for CAP read only.