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

Fix outdated GraphQL query, and attempt to introduce pagination #1504

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

christeredvartsen
Copy link
Member

NAIS API just released v1, and as a result of that the queries in "Teamkatalogen" must be updated.

v1 of NAIS API implements the Cursor Connections Specification instead of the limit / offset based pagination we previously had.

Basically we fetch a page of teams, and the pageInfo object holds information about how to continue to fetch more.

The query for a single team has not changed in v1, so there was no need to update that.

Also, the GraphQL endpoint has been changed from "/query" to "/graphql".

Take into consideration that Java is not a language that I use on a daily basis (this is probably the first time I have written Java in over 20 years), so feel free to make any change you deem necessary.

More info:

NAIS API just released v1, and as a result of that the queries in
"Teamkatalogen" must be updated. v1 of NAIS API implements the Cursor
Connections Specification instead of the limit / offset based pagination
we previously had.

Basically we fetch a page of teams, and the pageInfo object holds
information about how to continue to fetch more.

The query for single teams has not changed in v1, so no changes needed
to be made to that.

Also, the GraphQL endpoint has been changed from "/query" to "/graphql".

More info:

- https://github.com/nais/api/blob/main/docs/graphql_practices.md#pagination
- https://relay.dev/graphql/connections.htm
@erik-a-e erik-a-e merged commit 7df59fe into main Nov 26, 2024
7 checks passed
@erik-a-e erik-a-e deleted the nais-api-v1 branch November 26, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants