Skip to content

Commit

Permalink
feat: expand allowed amount to take for getAllPokemon
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Dec 15, 2023
1 parent dbf70d1 commit 69f193f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion graphql/resolvers.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type Query {
offset: Int = 0

"Return only this many results, starting from the offset"
take: Int = 1413
take: Int = 1422

"Reverses the dataset before paginating"
reverse: Boolean = false
Expand Down
2 changes: 1 addition & 1 deletion scripts/manual-tests/get-all-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
# Send the request
response = requests.post(
'http://localhost:4000',
json={'query': query, 'variables': {'offset': 0, 'take': 1413}},
json={'query': query, 'variables': {'offset': 0, 'take': 1422}},
headers={'Content-Type': 'application/json'}
)

Expand Down
10 changes: 5 additions & 5 deletions src/lib/validations/pokemonArgs/getAllPokemonArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export interface GetAllPokemonArgs extends BaseFuzzyArgs, BasePokemonArgs {
* Sets the offset where to start
* @default 0
* @minimum 0
* @maximum 1412
* @maximum 1421
*/
offset: number | Nullish;
/**
* Return only this many results, starting from the offset
* @default 1413
* @default 1422
* @minimum 1
* @maximum 1413
* @maximum 1422
*/
take: number | Nullish;
}
Expand All @@ -26,11 +26,11 @@ const getAllPokemonSchema: SchemaOf<GetAllPokemonArgs> = baseFuzzySchema //
.extend({
offset: s.number
.greaterThanOrEqual(0)
.lessThanOrEqual(1412)
.lessThanOrEqual(1421)
.nullish.transform((v) => v ?? 0),
take: s.number
.greaterThanOrEqual(1)
.lessThanOrEqual(1413)
.lessThanOrEqual(1422)
.nullish.transform((v) => v ?? 1)
});

Expand Down

0 comments on commit 69f193f

Please sign in to comment.