Skip to content

Commit 66b87b0

Browse files
enisdenjoardatan
andauthored
feat: useApolloInlineTrace plugin for federated tracing (v3) (#1621)
* WIP * designated plugin * WIP * implement using apollo's trace tree builder * tests and adjustments * precision with add seconds and nanos * tests adjustments and error cases * micro reorg * use optional chaining, tests will fail * even more tests * expect no errors * error expectations * create yoga for each test * test rewrite error * test array * adjust test naming * should not trace subscriptions * own tracing * fix import * changeset * adjust docs * should not handle subscriptions * useInlineTrace -> useApolloInlineTrace * adjust changeset * avoid using buffer * make sure the server closes * federated tracing example * Use yoga.fetch and fix ESM support * Fix tests and use btoa from ponyfill for Node 14 * Fix package name Co-authored-by: Arda TANRIKULU <[email protected]>
1 parent 310b066 commit 66b87b0

File tree

8 files changed

+901
-10
lines changed

8 files changed

+901
-10
lines changed

.changeset/silent-ants-vanish.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-yoga/plugin-apollo-inline-trace': major
3+
---
4+
5+
Implementation of Apollo's federated inline tracing

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"weak-napi": ""
9292
},
9393
"resolutions": {
94-
"@whatwg-node/fetch": "0.2.9",
94+
"@whatwg-node/fetch": "0.3.2",
9595
"@changesets/apply-release-plan": "6.0.0",
9696
"graphql": "16.6.0",
9797
"@types/react": "17.0.39",

packages/graphql-yoga/src/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,8 @@ export class YogaServer<
509509
})
510510
}
511511
return response
512-
} catch (e) {
512+
} catch (e: any) {
513+
this.logger.error(e)
513514
return new this.fetchAPI.Response('Internal Server Error', {
514515
status: 500,
515516
})

0 commit comments

Comments
 (0)