diff --git a/packages/query-graphql/src/module.ts b/packages/query-graphql/src/module.ts index 9e74c5f89..ce4e3890a 100644 --- a/packages/query-graphql/src/module.ts +++ b/packages/query-graphql/src/module.ts @@ -34,7 +34,7 @@ export interface NestjsQueryGraphqlModuleFeatureOpts { @Module({}) export class NestjsQueryGraphQLCoreModule { public static forRoot(opts: NestjsQueryGraphqlModuleRootOpts): DynamicModule { - const providers = [{ provide: dataLoaderOptionsToken(), useValue: opts.dataLoader ?? {} }] + const providers = [{ provide: dataLoaderOptionsToken, useValue: opts.dataLoader ?? {} }] return { module: NestjsQueryGraphQLCoreModule, diff --git a/packages/query-graphql/src/pipes/inject-data-loader-config.pipe.ts b/packages/query-graphql/src/pipes/inject-data-loader-config.pipe.ts index 6ce3cbc36..1b455dff6 100644 --- a/packages/query-graphql/src/pipes/inject-data-loader-config.pipe.ts +++ b/packages/query-graphql/src/pipes/inject-data-loader-config.pipe.ts @@ -2,7 +2,7 @@ import { Inject, Injectable, PipeTransform } from '@nestjs/common' import { ModuleRef } from '@nestjs/core' import { Options } from 'dataloader' -export const dataLoaderOptionsToken = () => 'DATALOADER_OPTIONS' +export const dataLoaderOptionsToken = 'DATALOADER_OPTIONS' as const; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type DataLoaderOptions = Options @@ -15,7 +15,7 @@ export class InjectDataLoaderConfigPipe implements PipeTransform { private moduleRef: ModuleRef ) { try { - this.options = this.moduleRef.get(dataLoaderOptionsToken(), { strict: false }) + this.options = this.moduleRef.get(dataLoaderOptionsToken, { strict: false }) } catch (error) { // }