# GraphQLService Service

Module
import { GraphQLService } from "@tsed/graphql"
Source/packages/graphql/src/services/GraphQLService.ts

# Overview

class GraphQLService {
    httpPort: string | number;
    constructor(expressApp: ExpressApplication, httpServer: HttpServer, injectorService: InjectorService);
    createServer(id: string, settings: IGraphQLSettings): Promise<any>;
    createSchema(buildSchemaOptions: BuildSchemaOptions): Promise<GraphQLSchema>;
    get(id?: string): ApolloServer | undefined;
    getSchema(id?: string): GraphQLSchema | undefined;
    has(id?: string): boolean;
    protected getResolvers(): Type<any>[];
    protected getDataSources(): {
        [serviceName: string]: DataSource;
    };
    protected createDataSources(dataSources: Function | undefined, serverConfigSources: Function | undefined): () => any;
}

# Members

httpPort: string | number

createServer(id: string, settings: IGraphQLSettings): Promise<any>

createSchema(buildSchemaOptions: BuildSchemaOptions): Promise<GraphQLSchema>

Create a new type-graphql Schema and bind it with Ts.ED injector.


get(id?: string): ApolloServer | undefined

Get an instance of ApolloServer from his id


getSchema(id?: string): GraphQLSchema | undefined

Get an instance of GraphQL schema from his id


has(id?: string): boolean

protected getResolvers(): Type<any>[]

protected getDataSources(): {
     [serviceName: string]: DataSource;
 };

protected createDataSources(dataSources: Function | undefined, serverConfigSources: Function | undefined): () => any

create a new dataSources function to use with apollo server config