@webundsoehne/nestjs-util-graphql v3.0.12
@webundsoehne/nestjs-util-graphql
Description
This is a collection of useful modules on creating a Nest project. Mostly all of this modules are used by the in-house boilerplate of Web & Söhne.
Modules
Filters
GraphQL Error Parser
Since nest.js
lets GraphQL
handle its errors its own way, graphqlErrorParser
is just a function instead of a filter. This will format the errors in the same way of the HTTP errors so you can also throw HTTP_STATUS
errors instead of plain GraphQLError
for more distinction and using the status code directly in the frontend. It will also add the GraphQL error field of which field this error is coming from.
Usage
Just add the error parser to the GraphQL Module itself.
import { GraphQLModule } from '@nestjs/graphql'
import { GraphQLErrorParser } from '@webundsoehne/nestjs-util-graphql'
import { Module } from '@nestjs/common'
@Module({
imports: [
GraphQLModule.forRoot({
formatError: GraphQLErrorParser
})
]
})
export class ServerModule {}
Stay in touch
- Author: Backend Team
- Website: Web & Söhne
7 months ago
10 months ago
10 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago