Skip to content

This repository is used to show the bug with GraphQL Fields middleware in NestJS.

Notifications You must be signed in to change notification settings

lenneTech/graphql-field-middleware

Repository files navigation

NestJS example for bug in GraphQL field middleware

Description

This repository is used to show the bug with GraphQL Fields middleware in NestJS.

Based on Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# 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

Install history

npm i -g @nestjs/cli
nest new graphql-field-middleware
cd graphql-field-middleware
npm i @nestjs/graphql @nestjs/apollo @apollo/server graphql

About

This repository is used to show the bug with GraphQL Fields middleware in NestJS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published