-
Notifications
You must be signed in to change notification settings - Fork 66
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
enhancement: add filtering, sorting, and pagination to GraphQL queries #763
Conversation
d0c8176
to
1d43beb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks really readable and easy to reason about. I've tested things in the playground and couldn't find any bugs. We reviewed the docs already. So LGMT 🚀
Add filtering functionality to GraphQL API; add E2E tests
…ueries (#755) * Add comments; rename to clearer variables * Add sorting and offset-based pagination
* Add PageInfo object to queries with a limit * Adjust tests * Change API response to snake_case
* Add docs for GraphQL filtering and pagination * Move QueryResponse to models module * Address rvmelkonian feedback * Address ra0x3 feedback
fada863
to
f378267
Compare
f378267
to
1a96d25
Compare
@deekerno Just need to fix these conflicts, then this is good to go in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
This is deekerno speaking as ra0x3. 😉
Closes #637, #656.
Changelog
arguments
module for turning query arguments into the newQueryParams
struct--
id
: select a record by its ID--
and
/or
: combine two filters together--
not
: negate the behavior of a filter--
has
: select records that have non-null values for columns in list--
in
: select records that have a value matching an element in set--
gt
/gte
/lt
/lte
(greater than, etc.): select records whose value satisfies the comparison condition--
between
: select records whose value falls between the bounds of the comparison conditionfuel-indexer-graphql
andfuel-indexer-graphql-parser
packagesTesting Plan
I've added extensive testing (15 new tests in total) for filtering and pagination, and unit tests have been adjusted where necessary. CI should pass.
Manual Testing
Feel free to peruse changes from the documentation PR for example queries that you can use for the block explorer indexer; there are pages for filtering and pagination as well as this page that contains a fully-featured example of all of the GraphQL querying functionality being used together (nested entities, sorting, pagination, and filtering).