From 1d22fce41993470c09fa4bee67bc3725a95ec253 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 1 May 2022 11:18:55 +0200 Subject: [PATCH 1/2] Updated to standard v17 --- index.js | 6 +++--- lib/gateway/service-map.js | 2 +- package.json | 2 +- test/app-decorator.js | 2 +- test/gateway/application-hooks.js | 4 ++-- test/gateway/pollingInterval.js | 10 +++++----- test/gateway/subscription-hooks.js | 2 +- test/subscription-hooks.js | 6 +++--- test/types/index.ts | 16 ++++++++-------- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/index.js b/index.js index 083d6fdf..12fd0950 100644 --- a/index.js +++ b/index.js @@ -169,9 +169,9 @@ const plugin = fp(async function (app, opts) { }), mutation: opts.defineMutation ? new GraphQLObjectType({ - name: 'Mutation', - fields: {} - }) + name: 'Mutation', + fields: {} + }) : undefined }) } diff --git a/lib/gateway/service-map.js b/lib/gateway/service-map.js index 7a2ee18a..eef1e575 100644 --- a/lib/gateway/service-map.js +++ b/lib/gateway/service-map.js @@ -119,7 +119,7 @@ async function buildServiceMap (services, errorHandler, log) { const url = new URL(Array.isArray(opts.url) ? opts.url[0] : opts.url) const serviceConfig = { - mandatory: mandatory, + mandatory, sendRequest: sendRequest(request, url, useSecureParse), close, async refresh () { diff --git a/package.json b/package.json index 40aa66d5..3d830caa 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "sinon": "^13.0.0", "snazzy": "^9.0.0", "split2": "^4.0.0", - "standard": "^16.0.3", + "standard": "^17.0.0", "tap": "^16.0.0", "tsd": "^0.20.0", "typescript": "^4.3.5", diff --git a/test/app-decorator.js b/test/app-decorator.js index bebf965e..138ae951 100644 --- a/test/app-decorator.js +++ b/test/app-decorator.js @@ -1162,7 +1162,7 @@ test('defineResolvers should throw if field is not defined in schema', async (t) } } - app.register(GQL, { schema: schema }) + app.register(GQL, { schema }) app.register(async function (app) { t.throws(function () { diff --git a/test/gateway/application-hooks.js b/test/gateway/application-hooks.js index c18f5f7a..b4c51128 100644 --- a/test/gateway/application-hooks.js +++ b/test/gateway/application-hooks.js @@ -55,7 +55,7 @@ test('onGatewayReplaceSchema - polling interval with a new schema should trigger name: String! } `, - resolvers: resolvers, + resolvers, federationMetadata: true }) @@ -145,7 +145,7 @@ test('onGatewayReplaceSchema - should log an error should any errors occur in th name: String! } `, - resolvers: resolvers, + resolvers, federationMetadata: true }) diff --git a/test/gateway/pollingInterval.js b/test/gateway/pollingInterval.js index a97c4f05..9a1649b4 100644 --- a/test/gateway/pollingInterval.js +++ b/test/gateway/pollingInterval.js @@ -53,7 +53,7 @@ test('Polling schemas', async (t) => { name: String! } `, - resolvers: resolvers, + resolvers, federationMetadata: true }) @@ -223,7 +223,7 @@ test('Polling schemas (gateway.polling interval is not a number)', async (t) => name: String! } `, - resolvers: resolvers, + resolvers, federationMetadata: true }) @@ -287,7 +287,7 @@ test("Polling schemas (if service is down, schema shouldn't be changed)", async name: String! } `, - resolvers: resolvers, + resolvers, federationMetadata: true }) @@ -443,7 +443,7 @@ test('Polling schemas (if service is mandatory, exception should be thrown)', as name: String! } `, - resolvers: resolvers, + resolvers, federationMetadata: true }) @@ -959,7 +959,7 @@ test('Polling schemas (subscriptions should be handled)', async (t) => { name: String! } `, - resolvers: resolvers, + resolvers, federationMetadata: true, subscription: true }) diff --git a/test/gateway/subscription-hooks.js b/test/gateway/subscription-hooks.js index 534d9cf2..ba91e55c 100644 --- a/test/gateway/subscription-hooks.js +++ b/test/gateway/subscription-hooks.js @@ -641,7 +641,7 @@ test('gateway - should call onSubscriptionEnd when subscription ends', async t = id: 1, type: 'stop', payload: { - query: query + query } })) diff --git a/test/subscription-hooks.js b/test/subscription-hooks.js index 602ce286..c3a61053 100644 --- a/test/subscription-hooks.js +++ b/test/subscription-hooks.js @@ -302,7 +302,7 @@ test('subscription - should handle onSubscriptionResolution hook errors', async id: 1, type: 'start', payload: { - query: query + query } })) @@ -341,7 +341,7 @@ test('subscription - should call onSubscriptionEnd when subscription ends', asyn id: 1, type: 'start', payload: { - query: query + query } })) @@ -382,7 +382,7 @@ test('subscription - should handle onSubscriptionEnd hook errors', async t => { id: 1, type: 'start', payload: { - query: query + query } })) diff --git a/test/types/index.ts b/test/types/index.ts index 2e60347f..5f2ac1c8 100644 --- a/test/types/index.ts +++ b/test/types/index.ts @@ -57,7 +57,7 @@ declare module '../../' { } app.register(mercurius, { - schema: schema, + schema, resolvers, loaders: {}, ide: false, @@ -83,7 +83,7 @@ app.register(mercurius, { }) app.register(mercurius, { - schema: schema, + schema, resolvers, loaders: {}, ide: false, @@ -452,7 +452,7 @@ gateway.register(mercurius, { // Subscriptions app.register(mercurius, { - schema: schema, + schema, resolvers, subscription: true }) @@ -460,7 +460,7 @@ app.register(mercurius, { const emitter = mq() app.register(mercurius, { - schema: schema, + schema, resolvers, subscription: { emitter, @@ -492,7 +492,7 @@ app.register(mercurius, { }) app.register(mercurius, { - schema: schema, + schema, resolvers, subscription: { context: async (connection, request) => { @@ -509,7 +509,7 @@ app.register(mercurius, { }) app.register(mercurius, { - schema: schema, + schema, resolvers, subscription: { emitter @@ -517,7 +517,7 @@ app.register(mercurius, { }) app.register(mercurius, { - schema: schema, + schema, resolvers, subscription: { fullWsTransport: true @@ -612,7 +612,7 @@ class CustomPubSub { } app.register(mercurius, { - schema: schema, + schema, resolvers, subscription: { pubsub: new CustomPubSub() From 81224d99f371b2d0ca69a0b57431ee93f679d065 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 1 May 2022 15:09:38 +0200 Subject: [PATCH 2/2] Bumped eslint-typescript dependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3d830caa..202d67af 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "@sinonjs/fake-timers": "^9.0.0", "@types/node": "^17.0.0", "@types/ws": "^8.2.0", - "@typescript-eslint/eslint-plugin": "^4.28.2", - "@typescript-eslint/parser": "^4.28.2", + "@typescript-eslint/eslint-plugin": "^5.21.0", + "@typescript-eslint/parser": "^5.21.0", "autocannon": "^7.3.0", "concurrently": "^7.0.0", "docsify-cli": "^4.4.3",