Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] how to use logger.assign with graphql #936

Open
kerituni12 opened this issue May 3, 2022 · 2 comments
Open

[QUESTION] how to use logger.assign with graphql #936

kerituni12 opened this issue May 3, 2022 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@kerituni12
Copy link

[x] I've read the docs of nestjs-pino

[x] I've read the docs of pino

[x] I couldn't find the same question about nestjs-pino

Question

How i can use logger.assign with nestjs graphql

PinoLoggerModule.forRoot({
      pinoHttp: {
        logger: logger,
        autoLogging: false,
      },
      forRoutes: [AppController, '*', { path: '/graphql', method: RequestMethod.ALL }],
      exclude: [{ method: RequestMethod.ALL, path: 'check' }],
    }),

I get the error unable to assign extra fields out of request scope

Please mention other relevant information such as Node.js version and Operating System.

@kerituni12 kerituni12 added the question Further information is requested label May 3, 2022
@kerituni12 kerituni12 changed the title [QUESTION] [QUESTION] how to use logger.assign with graphql May 3, 2022
@kerituni12
Copy link
Author

I tried with #788 (comment) but it doesn't work as expected

@iamolegga
Copy link
Owner

There are not any tests for assign in gql context, should be checked separately. You can try to create a test for this if you want to. I'll get back to this when I'll have free time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants