Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate field-based filter helpers #22

Open
vst opened this issue May 26, 2024 · 0 comments
Open

Generate field-based filter helpers #22

vst opened this issue May 26, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vst
Copy link
Owner

vst commented May 26, 2024

This is rather tricky, but the idea is to provide a codec and interpreter for the following:

{
  "_and": [
    {
      "id": {
        "_in": [
          1,
          2,
          3
        ]
      }
    },
    {
      "_not": {
        "name": {
          "_ilike": "%ignore%"
        }
      }
    },
    {
      "createdAt": {
        "_range": {
          "_start": "2012-12-12",
          "_end": "2014-12-12"
        }
      }
    }
  ]
}

The idea is similar to what PostgREST and Hasura provides. There is a trade-off between:

  1. An extensible DSL so that user can later provide custom filters, and
  2. A powerful DSL that can traverse through relationships.

Another challenge is providing an auth context for filtering: Some users should not be able to filter on certain fields/relationships to avoid information leakage.

@vst vst added the enhancement New feature or request label May 26, 2024
@vst vst self-assigned this May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant