From 98437cc33a5076f588630835924884b2401997ee Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Mon, 26 Oct 2020 09:50:04 +0100 Subject: [PATCH] package.json: remove apollo-server dependancy, using apollo-server-express instead --- package-lock.json | 12 ------------ package.json | 1 - src/datasources/db/cargobikeAPI.ts | 1 + src/datasources/db/lendingstationAPI.ts | 2 +- src/datasources/db/participantAPI.ts | 2 +- src/datasources/db/providerAPI.ts | 2 +- src/schema/type-defs.ts | 2 +- 7 files changed, 5 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0cc370..829a686 100644 --- a/package-lock.json +++ b/package-lock.json @@ -864,18 +864,6 @@ "zen-observable-ts": "^0.8.21" } }, - "apollo-server": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/apollo-server/-/apollo-server-2.17.0.tgz", - "integrity": "sha512-vVMu+VqjmsB6yk5iNTb/AXM6EJGd2uwzrcTAbwqvGI7GqCYDRZlGBwrQCjOU/jT/EPWdNRWks/qhJYiQMeVXSg==", - "requires": { - "apollo-server-core": "^2.17.0", - "apollo-server-express": "^2.17.0", - "express": "^4.0.0", - "graphql-subscriptions": "^1.0.0", - "graphql-tools": "^4.0.0" - } - }, "apollo-server-caching": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/apollo-server-caching/-/apollo-server-caching-0.5.2.tgz", diff --git a/package.json b/package.json index 8d895ba..5414519 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@types/crc": "^3.4.0" }, "dependencies": { - "apollo-server": "^2.17.0", "apollo-server-express": "^2.17.0", "crc": "^3.8.0", "dotenv": "^8.2.0", diff --git a/src/datasources/db/cargobikeAPI.ts b/src/datasources/db/cargobikeAPI.ts index 7126b95..4af0edf 100644 --- a/src/datasources/db/cargobikeAPI.ts +++ b/src/datasources/db/cargobikeAPI.ts @@ -410,6 +410,7 @@ export class CargoBikeAPI extends DataSource { if (await LockUtils.isLocked(entityManager, EquipmentType, 'et', equipmentType.id, userId)) { throw new GraphQLError('EquipmentType is locked by other user'); } + await ActionLogger.log(entityManager, EquipmentType, 'et', equipmentType, userId); await entityManager.getRepository(EquipmentType) .createQueryBuilder('et') .update() diff --git a/src/datasources/db/lendingstationAPI.ts b/src/datasources/db/lendingstationAPI.ts index 54b75cc..38cd82f 100644 --- a/src/datasources/db/lendingstationAPI.ts +++ b/src/datasources/db/lendingstationAPI.ts @@ -1,5 +1,5 @@ import { DataSource } from 'apollo-datasource'; -import { ApolloError, UserInputError } from 'apollo-server'; +import { ApolloError, UserInputError } from 'apollo-server-express'; import { GraphQLError } from 'graphql'; import { Connection, EntityManager, getConnection, QueryFailedError } from 'typeorm'; import { CargoBike } from '../../model/CargoBike'; diff --git a/src/datasources/db/participantAPI.ts b/src/datasources/db/participantAPI.ts index 5761549..ec15cab 100644 --- a/src/datasources/db/participantAPI.ts +++ b/src/datasources/db/participantAPI.ts @@ -5,7 +5,7 @@ import { Engagement } from '../../model/Engagement'; import { Participant } from '../../model/Participant'; import { EngagementType } from '../../model/EngagementType'; import { ActionLogger, genDateRange, LockUtils } from './utils'; -import { UserInputError } from 'apollo-server'; +import { UserInputError } from 'apollo-server-express'; import { GraphQLError } from 'graphql'; export class ParticipantAPI extends DataSource { diff --git a/src/datasources/db/providerAPI.ts b/src/datasources/db/providerAPI.ts index a7ffcf5..2f5f48e 100644 --- a/src/datasources/db/providerAPI.ts +++ b/src/datasources/db/providerAPI.ts @@ -2,7 +2,7 @@ import { DataSource } from 'apollo-datasource'; import { Connection, EntityManager, getConnection } from 'typeorm'; import { Provider } from '../../model/Provider'; import { Organisation } from '../../model/Organisation'; -import { UserInputError } from 'apollo-server'; +import { UserInputError } from 'apollo-server-express'; import { CargoBike } from '../../model/CargoBike'; import { LendingStation } from '../../model/LendingStation'; import { ActionLogger, LockUtils } from './utils'; diff --git a/src/schema/type-defs.ts b/src/schema/type-defs.ts index 0afe6cc..21f9524 100644 --- a/src/schema/type-defs.ts +++ b/src/schema/type-defs.ts @@ -1,4 +1,4 @@ -import { gql } from 'apollo-server'; +import { gql } from 'apollo-server-express'; export default gql`