fix(graphql): Add default parameters to access token resolver (#13535)

This commit is contained in:
Pedro Silva 2025-05-16 15:23:58 +01:00 committed by GitHub
parent 8e21ae3211
commit 7e6b853a6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -32,6 +32,9 @@ public class ListAccessTokensResolver
private static final String EXPIRES_AT_FIELD_NAME = "expiresAt";
private static final Integer DEFAULT_START = 0;
private static final Integer DEFAULT_COUNT = 20;
private final EntityClient _entityClient;
public ListAccessTokensResolver(final EntityClient entityClient) {
@ -46,8 +49,8 @@ public class ListAccessTokensResolver
final QueryContext context = environment.getContext();
final ListAccessTokenInput input =
bindArgument(environment.getArgument("input"), ListAccessTokenInput.class);
final Integer start = input.getStart();
final Integer count = input.getCount();
final Integer start = input.getStart() == null ? DEFAULT_START : input.getStart();
final Integer count = input.getCount() == null ? DEFAULT_COUNT : input.getCount();
final List<FacetFilterInput> filters =
input.getFilters() == null ? Collections.emptyList() : input.getFilters();

View File

@ -157,17 +157,17 @@ Input arguments for listing access tokens
"""
input ListAccessTokenInput {
"""
The starting offset of the result set
The starting offset of the result set, default is 0
"""
start: Int
"""
The number of results to be returned
The number of results to be returned, default is 20
"""
count: Int
"""
Facet filters to apply to search results
Facet filters to apply to search results, default is no filters
"""
filters: [FacetFilterInput!]
}