This repository is used to show the bug with GraphQL Fields middleware in NestJS.
Based on Nest framework TypeScript starter repository.
$ npm install
# start (in watch mode)
$ npm run start:dev
# open playground
$ open https://localhost:3000/graphql
# send query
query {
getLowerCase(input: {str: "Test"})
}
The expected result would be
{
"data": {
"getLowerCase": "test"
}
}
But the following result is returned:
{
"data": {
"getLowerCase": "Test"
}
}
"test" vs "Test"
In addition, no logs are output. What would be expected:
FieldMiddleware toLowerCase
value: Test
npm i -g @nestjs/cli
nest new graphql-field-middleware
cd graphql-field-middleware
npm i @nestjs/graphql @nestjs/apollo @apollo/server graphql