mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 09:58:14 +00:00
fix(graphql): Add default parameters to access token resolver (#13535)
This commit is contained in:
parent
8e21ae3211
commit
7e6b853a6d
@ -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();
|
||||
|
||||
|
||||
@ -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!]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user