It appears the code in this repository breaks when upgrading to the latest version of NestJS and GraphQL.
I created a new NestJS project (by cloning https://github.com/nestjs/typescript-starter.git) which uses NestJS v8. I then installed the GraphQL dependencies and copied over most of the code from this repository. However, when I run the code I get the following error:
[Nest] 14858 - 14/01/2022, 12:32:09 ERROR [ExceptionsHandler] args.pagingParams is not a function
TypeError: args.pagingParams is not a function
at AppResolver.getZips (/Users/craig/dev/serenade/experiments/nestjs-graphql-cursor-pagination-v2/src/app.resolver.ts:26:36)
at /Users/craig/dev/serenade/experiments/nestjs-graphql-cursor-pagination-v2/node_modules/@nestjs/core/helpers/external-context-creator.js:70:33
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at target (/Users/craig/dev/serenade/experiments/nestjs-graphql-cursor-pagination-v2/node_modules/@nestjs/core/helpers/external-context-creator.js:77:28)
at /Users/craig/dev/serenade/experiments/nestjs-graphql-cursor-pagination-v2/node_modules/@nestjs/core/helpers/external-proxy.js:9:24
It looks like NestJS v8 or the latest GraphQL libraries are somehow stripping the getZips args in app.resolver.ts down to a plain javascript object rather than an instance of the ConnectionArgs class.
It appears the code in this repository breaks when upgrading to the latest version of NestJS and GraphQL.
I created a new NestJS project (by cloning https://github.com/nestjs/typescript-starter.git) which uses NestJS v8. I then installed the GraphQL dependencies and copied over most of the code from this repository. However, when I run the code I get the following error:
It looks like NestJS v8 or the latest GraphQL libraries are somehow stripping the
getZips
args inapp.resolver.ts
down to a plain javascript object rather than an instance of theConnectionArgs
class.Please see https://github.com/cjmyles/nestjs-graphql-cursor-pagination-starter to reproduce the error.