# GraphQLService Service

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

# Overview

class GraphQLService {
httpPort<span class="token punctuation">:</span> <span class="token keyword">string</span> | <span class="token keyword">number</span><span class="token punctuation">;</span>
/**
 *
 * @type <span class="token punctuation">{</span>Map&lt;<span class="token keyword">any</span><span class="token punctuation">,</span> <span class="token keyword">any</span>&gt;<span class="token punctuation">}</span>
 * @<span class="token keyword">private</span>
 */

<span class="token keyword">constructor</span><span class="token punctuation">(</span>expressApp<span class="token punctuation">:</span> <a href="/api/common/platform-express/decorators/ExpressApplication.html"><span class="token">ExpressApplication</span></a><span class="token punctuation">,</span> httpServer<span class="token punctuation">:</span> <a href="/api/common/platform-builder/decorators/HttpServer.html"><span class="token">HttpServer</span></a><span class="token punctuation">,</span> injectorService<span class="token punctuation">:</span> <a href="/api/di/services/InjectorService.html"><span class="token">InjectorService</span></a><span class="token punctuation">)</span><span class="token punctuation">;</span>
/**
 *
 * @returns <span class="token punctuation">{</span>Promise&lt;ApolloServer&gt;<span class="token punctuation">}</span>
 */
<span class="token function">createServer</span><span class="token punctuation">(</span>id<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">,</span> settings<span class="token punctuation">:</span> <a href="/api/graphql/interfaces/IGraphQLSettings.html"><span class="token">IGraphQLSettings</span></a><span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token keyword">any</span>&gt;<span class="token punctuation">;</span>
/**
 * Create a new type-graphql <a href="/api/mongoose/decorators/Schema.html"><span class="token">Schema</span></a> and bind it with Ts.ED injector.
 * @param buildSchemaOptions
 */
<span class="token function">createSchema</span><span class="token punctuation">(</span>buildSchemaOptions<span class="token punctuation">:</span> BuildSchemaOptions<span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;GraphQLSchema&gt;<span class="token punctuation">;</span>
/**
 * <a href="/api/common/mvc/decorators/method/Get.html"><span class="token">Get</span></a> an instance of ApolloServer <span class="token keyword">from</span> his id
 * @returns ApolloServer
 */
<span class="token function">get</span><span class="token punctuation">(</span>id?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> ApolloServer | undefined<span class="token punctuation">;</span>
/**
 * <a href="/api/common/mvc/decorators/method/Get.html"><span class="token">Get</span></a> an instance of GraphQL schema <span class="token keyword">from</span> his id
 * @returns GraphQLSchema
 */
<span class="token function">getSchema</span><span class="token punctuation">(</span>id?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> GraphQLSchema | undefined<span class="token punctuation">;</span>
/**
 *
 * @param <span class="token punctuation">{</span><span class="token keyword">string</span><span class="token punctuation">}</span> id
 * @returns <span class="token punctuation">{</span><span class="token keyword">boolean</span><span class="token punctuation">}</span>
 */
<span class="token function">has</span><span class="token punctuation">(</span>id?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
/**
 *
 * @returns <span class="token punctuation">{</span><a href="/api/di/class/Provider.html"><span class="token">Provider</span></a>&lt;<span class="token keyword">any</span>&gt;<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">}</span>
 */
<span class="token keyword">protected</span> <span class="token function">getResolvers</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <a href="/api/core/interfaces/Type.html"><span class="token">Type</span></a>&lt;<span class="token keyword">any</span>&gt;<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">protected</span> <span class="token function">getDataSources</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
    <span class="token punctuation">[</span>serviceName<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">]</span><span class="token punctuation">:</span> DataSource<span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
/**
 * create a new dataSources function to use with apollo server config
 * @param dataSources
 * @param serverConfigSources
 */
<span class="token keyword">protected</span> <span class="token function">createDataSources</span><span class="token punctuation">(</span>dataSources<span class="token punctuation">:</span> Function | undefined<span class="token punctuation">,</span> serverConfigSources<span class="token punctuation">:</span> Function | undefined<span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> =&gt; <span class="token keyword">any</span><span class="token punctuation">;</span>

}