chore(api-key): Add pagination and ordering tests for API Keys GraphQL endpoint #3835
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR was originally created to fix the API Keys GraphQL resolver (See previous description below). But it was also fixed and merged in #3830. Since I added some tests, I rebased and kept the tests.
Description
This PR adds tests for ordering and paginating the API Key GraphQL endpoint.
Initial description below
Context
The pagination for the API Keys GraphQL resolver is not working properly.
Description
We used the following query:
which resulted in the following SQL:
This is due to Kaminari's way of handling pagination, which requires the
page
andper
methods to be called in a specific order.per
will then properly override thelimit
andoffset
. Ifper
is not called, Kaminari will define theOFFSET
using thepage
and default page size.