From 03001cb7e5af033b04b2c00308520cdd46326298 Mon Sep 17 00:00:00 2001 From: Urata Daiki <7nohe@users.noreply.github.com> Date: Tue, 21 Jan 2025 07:59:57 +0900 Subject: [PATCH 1/4] feat: Support string type for `pageParam` and `nextPageParam` options (#149) --- .../app/components/PaginatedPets.tsx | 2 +- examples/nextjs-app/package.json | 2 +- examples/petstore.yaml | 60 +++++++++- examples/react-app/package.json | 2 +- lefthook.yml | 2 +- src/cli.mts | 6 +- src/createUseQuery.mts | 110 ++++++++++++++---- tests/__snapshots__/createSource.test.ts.snap | 61 +++++++++- tests/__snapshots__/generate.test.ts.snap | 73 ++++++++++++ tests/createExports.test.ts | 6 + tests/inputs/petstore.yaml | 60 +++++++++- tests/service.test.ts | 1 + 12 files changed, 344 insertions(+), 41 deletions(-) diff --git a/examples/nextjs-app/app/components/PaginatedPets.tsx b/examples/nextjs-app/app/components/PaginatedPets.tsx index bfaee46..e153082 100644 --- a/examples/nextjs-app/app/components/PaginatedPets.tsx +++ b/examples/nextjs-app/app/components/PaginatedPets.tsx @@ -22,7 +22,7 @@ export default function PaginatedPets() { ))} - {data?.pages.at(-1)?.nextPage && ( + {data?.pages.at(-1)?.meta?.next && (