-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathscenario.js
More file actions
27 lines (22 loc) · 786 Bytes
/
scenario.js
File metadata and controls
27 lines (22 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { loggingTransport } = require('@sentry-internal/node-integration-tests');
const Sentry = require('@sentry/aws-serverless');
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
tracesSampleRate: 1.0,
integrations: [Sentry.graphqlIntegration({ useOperationNameForRootSpan: true })],
transport: loggingTransport,
});
async function run() {
const apolloServer = require('./apollo-server')();
await Sentry.startSpan({ name: 'Test Transaction' }, async span => {
// Ref: https://www.apollographql.com/docs/apollo-server/testing/testing/#testing-using-executeoperation
await apolloServer.executeOperation({
query: 'query GetHello {hello}',
});
setTimeout(() => {
span.end();
apolloServer.stop();
}, 500);
});
}
run();