@ogma/platform-graphql-fastify
TypeScript icon, indicating that this package has built-in type declarations

5.0.1 • Public • Published

@ogma/platform-graphql-fastify

The GraphQLFastifyParser parser for the OgmaInterceptor. This plugin class parses GraphQL request and response object to be able to successfully log the data about the request. For more information, check out the @ogma/nestjs-module documentation.

Installation

Nothing special, standard npm i @ogma/platform-graphql-fastify or yarn add @ogma/platform-graphql-fastify

Usage

This plugin is to be used in the OgmaInterceptorOptions portion of the OgmaModule during forRoot or forRootAsync registration. It can be used like so:

@Module(
  OgmaModule.forRoot({
    interceptor: {
      gql: GraphQLFastifyParser
    }
  })
)
export class AppModule {}

Note: Due to the nature of subscriptions and the data available from the base ones, it is not possible at this time to log what subscriptions are made in the Ogma fashion.

Because the interceptor needs access to the request and response objects, when configuring the GraphqlModule from Nest, you need to add the request and reply to the GraphQL context. to do this, while configuring the GraphqlModule, set the context property as such:

GraphqlModule.forRoot({
  context: ({ request, reply }) => ({ request, reply })
});

Package Sidebar

Install

npm i @ogma/platform-graphql-fastify

Weekly Downloads

2

Version

5.0.1

License

MIT

Unpacked Size

14.5 kB

Total Files

8

Last publish

Collaborators

  • jmcdo29
  • jeffminsungkim