message: Add mergeSchemas logic
diff: import { IResolvers, makeExecutableSchema, SchemaDirectiveVisitor, ILogger, mergeSchemas, IDirectiveResolvers, IResolverValidationOptions } from 'graphql-tools';
  import { mergeGraphQLSchemas, mergeResolvers } from '@graphql-modules/epoxy';
  import { Provider, Injector, ProviderScope } from '@graphql-modules/di';
  -import { DocumentNode, GraphQLSchema, parse, GraphQLScalarType } from 'graphql';
  +import { DocumentNode, GraphQLSchema, parse, GraphQLScalarType, buildASTSchema } from 'graphql';
  import { IResolversComposerMapping, composeResolvers } from './resolvers-composition';
  import { DepGraph } from 'dependency-graph';
  import { DependencyModuleNotFoundError, SchemaNotValidError, DependencyModuleUndefinedError, TypeDefNotFoundError, ModuleConfigRequiredError, IllegalResolverInvocationError, ContextBuilderError } from './errors';
  @@ -227,14 +227,39 @@ export class GraphQLModule<Config = any, Session = any, Context = any> {
  return this._cache.directiveResolvers;
  }
  - /**
  - * Gets the application `GraphQLSchema` object.
  - * If the schema object is not built yet, it compiles
  - * the `typeDefs` and `resolvers` into `GraphQLSchema`
  - */
  - get schema() {
  - if (typeof this._cache.schema === 'undefined') {
  - this.checkConfiguration();
  + buildSchemaWithMergeSchemas() {
  + const modulesMap = this.modulesMap;
  + const schemaSet = new Set<GraphQLSchema>();
  + this.iterateOverImports(module => {
  + module.fixCacheForModulesMap(modulesMap, 'schema');
  + const moduleSchema = module.schema;
  + if (moduleSchema) {
  + schemaSet.add(moduleSchema);
  + }
  + });
  + const selfTypeDefs = this.selfTypeDefs;
  + if (selfTypeDefs) {
  + schemaSet.add(buildASTSchema(selfTypeDefs, {
  + assumeValid: true,
  + assumeValidSDL: true,
  + }));
  + }
  + const selfExtraSchemas = this.selfExtraSchemas;
  + const selfResolvers = this.addSessionInjectorToSelfResolversContext();
  + const selfResolversComposition = this.addSessionInjectorToSelfResolversCompositionContext();
  + const selfComposedResolvers = composeResolvers(
  + selfResolvers,
  + selfResolversComposition,
  + );
  + const selfSchemaDirectives = this.selfSchemaDirectives;
  + this._cache.schema = mergeSchemas({
  + schemas: [ ...selfExtraSchemas, ...schemaSet],
  + resolvers: selfComposedResolvers,
  + schemaDirectives: selfSchemaDirectives,
  + });
  + }
  +
  + buildSchemaWithMakeExecutableSchema() {
  try {
  const typeDefs = this.typeDefs;
  const resolvers = this.resolvers;
  @@ -272,6 +297,17 @@ export class GraphQLModule<Config = any, Session = any, Context = any> {
  this._cache.schema = null;
  }
  }
  + }
  +
  + /**
  + * Gets the application `GraphQLSchema` object.
  + * If the schema object is not built yet, it compiles
  + * the `typeDefs` and `resolvers` into `GraphQLSchema`
  + */
  + get schema() {
  + if (typeof this._cache.schema === 'undefined') {
  + this.checkConfiguration();
  + this.buildSchemaWithMakeExecutableSchema();
  if ('middleware' in this._options) {
  const middlewareResult = this._options.middleware(this._cache);
  this._cache = Object.assign(this._cache, middlewareResult);
  