@nestjs/graphql
Version:
GraphQL for NestJS: code-first and schema-first APIs, resolvers as providers, subscriptions, federation and generated SDL, on Apollo or Mercurius.
47 lines • 2.53 kB
TypeScript
import { GraphQLSchema } from 'graphql';
import { GraphQLSchemaBuilder } from '../graphql-schema.builder.js';
import { AutoSchemaFileValue, BuildFederatedSchemaOptions, GqlModuleOptions } from '../interfaces/index.js';
import { ResolversExplorerService, ScalarsExplorerService } from '../services/index.js';
import { TypeDefsDecoratorFactory } from './type-defs-decorator.factory.js';
/**
* @publicApi
*/
export declare class GraphQLFederationFactory {
private readonly resolversExplorerService;
private readonly scalarsExplorerService;
private readonly gqlSchemaBuilder;
private readonly typeDefsDecoratorFactory;
private readonly logger;
constructor(resolversExplorerService: ResolversExplorerService, scalarsExplorerService: ScalarsExplorerService, gqlSchemaBuilder: GraphQLSchemaBuilder, typeDefsDecoratorFactory: TypeDefsDecoratorFactory);
generateSchema<T extends GqlModuleOptions>(options?: T, buildFederatedSchema?: (options: BuildFederatedSchemaOptions) => GraphQLSchema): Promise<GraphQLSchema>;
private buildSchemaFromTypeDefs;
private generateSchemaFromCodeFirst;
/**
* Collects the resolvers the same way "GraphQLFactory" does: the discovered
* resolvers are passed through "transformResolvers" and then merged with the
* "resolvers" option field by field, so that a type named in that option
* keeps the (enhancer-wrapped) field resolvers discovered for it.
*/
private getResolvers;
/**
* "@apollo/subgraph" attaches resolvers to the schema in place, so custom
* scalars attached there would already be in effect when
* "addResolversToSchema" converts the (still raw) default values of the
* type definitions, running them through "serialize" before "parseValue".
* Hence only "__resolveReference", which "addResolversToSchema" cannot
* attach, is handed over to it.
*/
private getReferenceResolvers;
private overrideOrExtendResolvers;
/**
* Ensures that the resolveType method for unions and interfaces in the federated schema
* is properly set from the one in the autoGeneratedSchema.
*/
private overrideFederatedResolveType;
buildFederatedSchema<T extends GqlModuleOptions>(autoSchemaFile: AutoSchemaFileValue, options: T, resolvers: Function[]): Promise<GraphQLSchema>;
private loadApolloSubgraph;
private getFederationSchemaPrinter;
private getFederationVersionAndConfig;
private isEmptyValue;
}
//# sourceMappingURL=graphql-federation.factory.d.ts.map