Major refactor
This commit is contained in:
+17
-7
@@ -10,21 +10,31 @@ import { OrderAPI } from './datasources/order-api';
|
||||
import { ProductAPI } from './datasources/product-api';
|
||||
import { DesignerAPI } from './datasources/designer-api';
|
||||
import { Api2DataSource } from './datasources/api2-datasource';
|
||||
import { Api1DataSource } from './datasources/api1-datasource';
|
||||
|
||||
import { verifyToken } from './cognito/cognito-client';
|
||||
import { CategoryAPI } from './datasources/category-api';
|
||||
|
||||
console.log(`dbConfig`, dbConfig);
|
||||
|
||||
// Should we convert columns?
|
||||
const knexConfig = knexStringcase(dbConfig);
|
||||
|
||||
// TODO: Try with this to see if - tables don't get converted
|
||||
// delete knexConfig.appWrapIdentifier;
|
||||
|
||||
// set up any dataSources our resolvers need
|
||||
const api1 = new Api1DataSource();
|
||||
const api2 = new Api2DataSource();
|
||||
const orderApi = new OrderAPI(knexConfig);
|
||||
const productApi = new ProductAPI(knexConfig);
|
||||
const categoryApi = new CategoryAPI(knexConfig);
|
||||
const designerApi = new DesignerAPI(knexConfig);
|
||||
|
||||
const dataSources = () => ({
|
||||
orderApi: new OrderAPI(knexConfig),
|
||||
productApi: new ProductAPI(knexConfig),
|
||||
designerApi: new DesignerAPI(knexConfig),
|
||||
api2: new Api2DataSource(),
|
||||
api1,
|
||||
api2,
|
||||
categoryApi,
|
||||
designerApi,
|
||||
orderApi,
|
||||
productApi,
|
||||
});
|
||||
|
||||
const context = async ({ req }) => {
|
||||
|
||||
Reference in New Issue
Block a user