126: upgrade libs for graphql major versions (#127)

* upgraded minor and patch libraries

* upgrade lock file for tests

* 126: upgraded all major versions in package.json

* removed unused import
This commit is contained in:
Arwid Thornström
2022-11-01 12:43:18 +01:00
committed by GitHub
parent 08c6e5718b
commit 72f2e0cb56
7 changed files with 1406 additions and 2523 deletions
+1280 -2434
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -21,14 +21,14 @@
"@aws-sdk/client-sqs": "^3.194.0",
"@aws-sdk/client-translate": "^3.195.0",
"@aws-sdk/s3-request-presigner": "^3.194.0",
"@newrelic/apollo-server-plugin": "^1.3.0",
"@newrelic/apollo-server-plugin": "^2.0.1",
"apollo-datasource": "^3.3.2",
"apollo-datasource-rest": "^3.7.0",
"apollo-server": "^3.10.3",
"apollo-server-caching": "^3.3.0",
"async-redis": "^2.0.0",
"axios": "^0.27.2",
"datasource-sql": "^1.6.0",
"axios": "^1.1.3",
"datasource-sql": "^2.0.1",
"dotenv": "^16.0.3",
"graphql": "^16.6.0",
"graphql-scalars": "^1.20.0",
@@ -36,12 +36,12 @@
"jwk-to-pem": "^2.0.5",
"knex": "^2.3.0",
"knex-stringcase": "^1.4.6",
"newrelic": "^8.17.1",
"newrelic": "^9.4.0",
"nodemon": "^2.0.20",
"pg": "^8.8.0",
"pg-hstore": "^2.3.4",
"prettier": "^2.7.1",
"slug": "^5.3.0",
"slug": "^8.2.2",
"stringcase": "^4.3.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
@@ -49,15 +49,15 @@
"validator": "^13.7.0"
},
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/jest": "^29.2.0",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"isomorphic-fetch": "^3.0.0",
"jest": "^28.1.3",
"jest": "^29.2.2",
"testcontainers": "^8.16.0",
"ts-jest": "^28.0.8"
"ts-jest": "^29.0.3"
}
}
+10 -6
View File
@@ -29,6 +29,7 @@ WHERE product_category.product_id = ?
}
async getCategories(): Promise<Array<Category>> {
// @ts-ignore
return this.knex.select('*').from('v_categorytree').cache(MINUTE);
}
@@ -40,12 +41,15 @@ WHERE product_category.product_id = ?
}
async getCategoryById(id: number): Promise<Category> {
return this.knex
.select('*')
.from('v_categorytree')
.where('id', id)
.first()
.cache(MINUTE);
return (
this.knex
.select('*')
.from('v_categorytree')
.where('id', id)
.first()
// @ts-ignore
.cache(MINUTE)
);
}
async getLocaleNameForId(id: number): Promise<JSON> {
+34 -28
View File
@@ -9,19 +9,22 @@ export class DesignerAPI extends BaseSQLDataSource {
}
async getDesignerById(id: number): Promise<Designer> {
return this.knex
.select('*')
.from('designers')
.where('designerid', id)
.first()
.cache(MINUTE)
.then((row) => {
return {
...row,
id: row.designerid,
excludeFromSearch: !row.visibleSearch || !row.visibleDesignerpage,
};
});
return (
this.knex
.select('*')
.from('designers')
.where('designerid', id)
.first()
// @ts-ignore
.cache(MINUTE)
.then((row) => {
return {
...row,
id: row.designerid,
excludeFromSearch: !row.visibleSearch || !row.visibleDesignerpage,
};
})
);
}
async searchDesigners(name: string): Promise<Array<Designer>> {
@@ -42,20 +45,23 @@ export class DesignerAPI extends BaseSQLDataSource {
async getDesigners(limit: Maybe<number>): Promise<Array<Designer>> {
limit = limit ?? 5000;
return this.knex
.select('*')
.from('designers')
.limit(limit)
.orderBy('name')
.cache(MINUTE)
.then((rows) => {
return rows.map((row) => {
return {
...row,
id: row.designerid,
excludeFromSearch: !row.visibleSearch || !row.visibleDesignerpage,
};
});
});
return (
this.knex
.select('*')
.from('designers')
.limit(limit)
.orderBy('name')
// @ts-ignore
.cache(MINUTE)
.then((rows) => {
return rows.map((row) => {
return {
...row,
id: row.designerid,
excludeFromSearch: !row.visibleSearch || !row.visibleDesignerpage,
};
});
})
);
}
}
+11 -8
View File
@@ -48,14 +48,17 @@ ORDER BY keywords.value
}
async getKeywordById(id: number): Promise<Keyword> {
return this.knex
.select('*')
.from('keywords')
.leftJoin('keyword_type', 'keyword_type.keyword_id', 'keywords.id')
.where('id', id)
.first()
.cache(MINUTE)
.then((row) => this.getType(row));
return (
this.knex
.select('*')
.from('keywords')
.leftJoin('keyword_type', 'keyword_type.keyword_id', 'keywords.id')
.where('id', id)
.first()
// @ts-ignore
.cache(MINUTE)
.then((row) => this.getType(row))
);
}
async searchKeywords(name: string): Promise<Array<Keyword>> {
+50 -32
View File
@@ -10,52 +10,70 @@ export class MarketLocaleAPI extends SQLDataSource {
}
async getMarketById(id: number): Promise<Market> {
return this.knex
.select('*')
.from('markets')
.where('id', id)
.first()
.cache(MINUTE * 5);
return (
this.knex
.select('*')
.from('markets')
.where('id', id)
.first()
// @ts-ignore
.cache(MINUTE * 5)
);
}
async getMarketByName(name: string): Promise<Market> {
return this.knex
.select('*')
.from('markets')
.where('name', name)
.first()
.cache(MINUTE * 5);
return (
this.knex
.select('*')
.from('markets')
.where('name', name)
.first()
// @ts-ignore
.cache(MINUTE * 5)
);
}
async getMarkets(): Promise<Array<Market>> {
return this.knex
.select('*')
.from('markets')
.cache(MINUTE * 5);
return (
this.knex
.select('*')
.from('markets')
// @ts-ignore
.cache(MINUTE * 5)
);
}
async getLocaleById(id: number): Promise<Locale> {
return this.knex
.select('*')
.from('locales')
.where('id', id)
.first()
.cache(MINUTE * 5);
return (
this.knex
.select('*')
.from('locales')
.where('id', id)
.first()
// @ts-ignore
.cache(MINUTE * 5)
);
}
async getLocaleByValue(value: string): Promise<Locale> {
return this.knex
.select('*')
.from('locales')
.where('value', value)
.first()
.cache(MINUTE * 5);
return (
this.knex
.select('*')
.from('locales')
.where('value', value)
.first()
// @ts-ignore
.cache(MINUTE * 5)
);
}
async getLocales(): Promise<Array<Locale>> {
return this.knex
.select('*')
.from('locales')
.cache(MINUTE * 5);
return (
this.knex
.select('*')
.from('locales')
// @ts-ignore
.cache(MINUTE * 5)
);
}
}
+13 -7
View File
@@ -14,6 +14,7 @@ export class OrderAPI extends BaseSQLDataSource {
.from('addresses')
.where('id', addressId)
.first()
// @ts-ignore
.cache(MINUTE);
return row
@@ -34,6 +35,7 @@ export class OrderAPI extends BaseSQLDataSource {
.clone()
.count()
.first()
// @ts-ignore
.cache(MINUTE * 5);
return res['count'] as number; // Optimize later to return Promise
}
@@ -44,6 +46,7 @@ export class OrderAPI extends BaseSQLDataSource {
let query = this.getOrdersQuery(input).limit(limit).offset(offset);
query = query.orderBy('inserted', 'ASC');
// @ts-ignore
return query.cache(MINUTE);
}
@@ -73,13 +76,16 @@ export class OrderAPI extends BaseSQLDataSource {
: 'klarna_order_id';
const value = paypalTransactionId ?? klarnaOrderId;
return this.knex
.select('*')
.from('orders')
.where(column, value)
.orderBy('id')
.first()
.cache(MINUTE);
return (
this.knex
.select('*')
.from('orders')
.where(column, value)
.orderBy('id')
.first()
// @ts-ignore
.cache(MINUTE)
);
}
async getOrderRowsByOrderId(orderId: number): Promise<Array<OrderRow>> {