subql icon indicating copy to clipboard operation
subql copied to clipboard

Query service, add query filter for virtual fields and sortable

Open jiqiang90 opened this issue 2 years ago • 2 comments

Prerequisites

  • [x] Are you running the latest version(s)?
  • [x] Did you check the debugging guide?
  • [x] Did you check the FAQs and Discussions?
  • [x] Are you reporting to the correct repository?
  • [x] Did you search for an existing issue or pull request?

Description

We want a feature allow user to filter the virtual fields/entity's attributes when query, for example:

we want to sort authors by the amount of books written after a certain year

type Author @entity{
  id:ID!
  books: [Book]! @derivedFrom(field:"author")
}

type Book @entity{
  id:ID!
author: Author!
year: Int!
}
  • [x] add filter for connection fields
  • [ ] make compute column sortable

Details

These details can help to reproduce the environment the issue is occurring

Local Environment: [You can get this information from executing subql version.] Query Version: [What is the version of the query service?] Indexer Version: [What is the version of the indexer service?] Network Details:

  • [Network]
  • [Block height, a block height where the issue is happening]
  • [Dictionary endpoint, if used]

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Example project: [A link to a minimal example that can reproduce the issue]

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Any other information

Is there any other information you would like to add?

jiqiang90 avatar Jan 08 '23 21:01 jiqiang90

Useful tickets:

https://github.com/graphile/pg-aggregates/issues/25

https://github.com/graphile-contrib/postgraphile-plugin-connection-filter/issues/152

jiqiang90 avatar Jan 10 '23 04:01 jiqiang90

Waiting for help on https://github.com/graphile/pg-aggregates/issues/36

jiqiang90 avatar Jan 10 '23 06:01 jiqiang90