Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

Commit 7b51d3c

Browse files
authored
chore: update to latest arc (#143)
1 parent 8c75410 commit 7b51d3c

File tree

3 files changed

+58
-104
lines changed

3 files changed

+58
-104
lines changed

mocks/arc-basic-events/lib/graphql.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
22
require('esbuild-register')
33
const { makeExecutableSchema } = require('@graphql-tools/schema')
4-
const { tables: arcTables } = require('@architect/functions')
4+
const { tables: arcTables, ws } = require('@architect/functions')
55
const { makeServer, subscribe } = require('../../../lib')
6-
const { ApiGatewayManagementApi } = require('aws-sdk')
76
const { GraphQLError } = require('graphql')
87

9-
const makeManagementAPI = () => {
10-
const ARC_WSS_URL = process.env.ARC_WSS_URL
11-
const port = process.env.ARC_INTERNAL || '3332'
12-
13-
if (process.env.NODE_ENV === 'testing') {
14-
return new ApiGatewayManagementApi({
15-
apiVersion: '2018-11-29',
16-
endpoint: `http://localhost:${port}/_arc/ws`,
17-
region: process.env.AWS_REGION || 'us-west-2',
18-
})
19-
}
20-
return new ApiGatewayManagementApi({
21-
apiVersion: '2018-11-29',
22-
endpoint: `${ARC_WSS_URL.replace(/$ws/, 'http')}`,
23-
})
24-
}
25-
268
const typeDefs = `
279
type Query {
2810
hello: String
@@ -183,7 +165,7 @@ const subscriptionServer = makeServer({
183165
dynamodb: arcTables.db,
184166
schema,
185167
tableNames: fetchTableNames(),
186-
apiGatewayManagementApi: makeManagementAPI(),
168+
apiGatewayManagementApi: ws._api,
187169
onError: err => {
188170
console.log('onError', err.message)
189171
},

package-lock.json

Lines changed: 54 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"graphql": ">= 16.0.0"
4343
},
4444
"devDependencies": {
45-
"@architect/functions": "^4.0.0",
46-
"@architect/sandbox": "^4.3.0",
45+
"@architect/functions": "^4.1.0",
46+
"@architect/sandbox": "^4.4.0",
4747
"@graphql-tools/schema": "^8.0.3",
4848
"@microsoft/api-extractor": "^7.18.15",
4949
"@types/architect__sandbox": "^3.3.3",

0 commit comments

Comments
 (0)