|
@@ -8,7 +8,7 @@ import { ServiceModule } from '../service/service.module';
|
|
|
|
|
|
|
|
import { IdCodecService } from './common/id-codec.service';
|
|
import { IdCodecService } from './common/id-codec.service';
|
|
|
import { RequestContextService } from './common/request-context.service';
|
|
import { RequestContextService } from './common/request-context.service';
|
|
|
-import { configureGraphQLModule } from './config/graphql-config.service';
|
|
|
|
|
|
|
+import { configureGraphQLModule } from './config/configure-graphql-module';
|
|
|
import { AssetInterceptor } from './middleware/asset-interceptor';
|
|
import { AssetInterceptor } from './middleware/asset-interceptor';
|
|
|
import { AuthGuard } from './middleware/auth-guard';
|
|
import { AuthGuard } from './middleware/auth-guard';
|
|
|
import { IdInterceptor } from './middleware/id-interceptor';
|
|
import { IdInterceptor } from './middleware/id-interceptor';
|
|
@@ -82,15 +82,15 @@ const entityResolvers = [
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
@Module({
|
|
@Module({
|
|
|
- imports: [ServiceModule, DataImportModule],
|
|
|
|
|
- providers: [IdCodecService, ...adminResolvers, ...entityResolvers],
|
|
|
|
|
|
|
+ imports: [PluginModule, ServiceModule, DataImportModule],
|
|
|
|
|
+ providers: [IdCodecService, ...adminResolvers, ...entityResolvers, ...PluginModule.adminApiResolvers()],
|
|
|
exports: adminResolvers,
|
|
exports: adminResolvers,
|
|
|
})
|
|
})
|
|
|
class AdminApiModule {}
|
|
class AdminApiModule {}
|
|
|
|
|
|
|
|
@Module({
|
|
@Module({
|
|
|
- imports: [ServiceModule],
|
|
|
|
|
- providers: [IdCodecService, ...shopResolvers, ...entityResolvers],
|
|
|
|
|
|
|
+ imports: [PluginModule, ServiceModule],
|
|
|
|
|
+ providers: [IdCodecService, ...shopResolvers, ...entityResolvers, ...PluginModule.shopApiResolvers()],
|
|
|
exports: shopResolvers,
|
|
exports: shopResolvers,
|
|
|
})
|
|
})
|
|
|
class ShopApiModule {}
|
|
class ShopApiModule {}
|
|
@@ -107,6 +107,7 @@ class ShopApiModule {}
|
|
|
AdminApiModule,
|
|
AdminApiModule,
|
|
|
ShopApiModule,
|
|
ShopApiModule,
|
|
|
configureGraphQLModule(configService => ({
|
|
configureGraphQLModule(configService => ({
|
|
|
|
|
+ apiType: 'shop',
|
|
|
apiPath: configService.shopApiPath,
|
|
apiPath: configService.shopApiPath,
|
|
|
typePaths: ['type', 'shop-api', 'common'].map(p =>
|
|
typePaths: ['type', 'shop-api', 'common'].map(p =>
|
|
|
path.join(__dirname, 'schema', p, '*.graphql'),
|
|
path.join(__dirname, 'schema', p, '*.graphql'),
|
|
@@ -114,13 +115,13 @@ class ShopApiModule {}
|
|
|
resolverModule: ShopApiModule,
|
|
resolverModule: ShopApiModule,
|
|
|
})),
|
|
})),
|
|
|
configureGraphQLModule(configService => ({
|
|
configureGraphQLModule(configService => ({
|
|
|
|
|
+ apiType: 'admin',
|
|
|
apiPath: configService.adminApiPath,
|
|
apiPath: configService.adminApiPath,
|
|
|
typePaths: ['type', 'admin-api', 'common'].map(p =>
|
|
typePaths: ['type', 'admin-api', 'common'].map(p =>
|
|
|
path.join(__dirname, 'schema', p, '*.graphql'),
|
|
path.join(__dirname, 'schema', p, '*.graphql'),
|
|
|
),
|
|
),
|
|
|
resolverModule: AdminApiModule,
|
|
resolverModule: AdminApiModule,
|
|
|
})),
|
|
})),
|
|
|
- PluginModule,
|
|
|
|
|
],
|
|
],
|
|
|
providers: [
|
|
providers: [
|
|
|
...entityResolvers,
|
|
...entityResolvers,
|