Skip to content

add support for graphql-yoga v3 executor#3610

Merged
khanayan123 merged 8 commits into
masterfrom
khanayan123/add-instrumentation-for-graphql-yogav3
Sep 25, 2023
Merged

add support for graphql-yoga v3 executor#3610
khanayan123 merged 8 commits into
masterfrom
khanayan123/add-instrumentation-for-graphql-yogav3

Conversation

@khanayan123

Copy link
Copy Markdown
Collaborator

What does this PR do?

adds support for graphql-yoga v3 executor

Motivation

customer request: #2884

Additional Notes

it was a bit challenging to figure out which v3 version of graphql-yoga added @graphql-tools/executor for execution. Upon testing it seems like it was added with 3.6.0^ minor release

@khanayan123
khanayan123 requested a review from tlhunter September 6, 2023 00:28
@khanayan123
khanayan123 requested review from a team as code owners September 6, 2023 00:28
@khanayan123
khanayan123 requested a review from jbertran September 6, 2023 00:28
@github-actions

github-actions Bot commented Sep 6, 2023

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 5.22 MB
Deduped: 60.71 MB
No deduping: 60.88 MB

Dependency sizes

name version self size total size
@datadog/native-iast-taint-tracking 1.5.0 14.86 MB 14.86 MB
@datadog/native-appsec 4.0.0 14.83 MB 14.83 MB
@datadog/pprof 3.2.0 10.8 MB 11.64 MB
protobufjs 7.2.4 2.74 MB 6.52 MB
@datadog/native-iast-rewriter 2.1.3 2.23 MB 2.32 MB
@opentelemetry/core 1.14.0 872.87 kB 1.47 MB
@datadog/native-metrics 2.0.0 898.77 kB 1.3 MB
@opentelemetry/api 1.4.1 780.32 kB 780.32 kB
import-in-the-middle 1.4.2 41.4 kB 704.79 kB
msgpack-lite 0.1.26 201.16 kB 281.59 kB
opentracing 0.14.7 194.81 kB 194.81 kB
semver 7.5.4 93.4 kB 123.8 kB
@datadog/sketches-js 2.1.0 109.9 kB 109.9 kB
lodash.sortby 4.7.0 75.76 kB 75.76 kB
lru-cache 7.14.0 74.95 kB 74.95 kB
ipaddr.js 2.1.0 60.23 kB 60.23 kB
ignore 5.2.4 51.22 kB 51.22 kB
int64-buffer 0.1.10 49.18 kB 49.18 kB
istanbul-lib-coverage 3.2.0 29.34 kB 29.34 kB
lodash.uniq 4.5.0 25.01 kB 25.01 kB
limiter 1.1.5 23.17 kB 23.17 kB
retry 0.13.1 18.85 kB 18.85 kB
lodash.kebabcase 4.1.1 17.75 kB 17.75 kB
node-abort-controller 3.1.1 16.89 kB 16.89 kB
lodash.pick 4.4.0 16.33 kB 16.33 kB
crypto-randomuuid 1.0.0 11.18 kB 11.18 kB
diagnostics_channel 1.1.0 7.07 kB 7.07 kB
path-to-regexp 0.1.7 6.78 kB 6.78 kB
koalas 1.0.2 6.47 kB 6.47 kB
methods 1.1.2 5.29 kB 5.29 kB
module-details-from-path 1.0.3 4.47 kB 4.47 kB

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@khanayan123
khanayan123 force-pushed the khanayan123/add-instrumentation-for-graphql-yogav3 branch from 272f485 to 48ab03e Compare September 6, 2023 00:29
@codecov

codecov Bot commented Sep 6, 2023

Copy link
Copy Markdown

Codecov Report

Merging #3610 (4242517) into master (a4ad9c7) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3610   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files         219      219           
  Lines        8961     8961           
  Branches       33       33           
=======================================
  Hits         7597     7597           
  Misses       1364     1364           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pr-commenter

pr-commenter Bot commented Sep 6, 2023

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2023-09-22 21:04:54

Comparing candidate commit 4242517 in PR branch khanayan123/add-instrumentation-for-graphql-yogav3 with baseline commit a4ad9c7 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 380 metrics, 12 unstable metrics.

@khanayan123

Copy link
Copy Markdown
Collaborator Author

the presence of graphql@^15.2.0 in versions causes the apollo core test to fail

Qard
Qard previously approved these changes Sep 6, 2023
@khanayan123
khanayan123 requested a review from rochdev September 6, 2023 14:20
'node:fs': () => require('../fs'),
'generic-pool': () => require('../generic-pool'),
'graphql': () => require('../graphql'),
'@graphql-tools/executor': () => require('../graphql'),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's organize this alphabetically to make it easier to read.

})
}

addHook({ name: '@graphql-tools/executor', file: 'cjs/execution/execute.js', versions: ['>=0.0.14'] }, execute => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that ESM is not supported?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested it with ESM yet. But this is more of a feature request to support graphql-yoga v3 #2884 which uses @graphlql-tools/executor as it's executor rather the the graphql executor

return agent.load('graphql')
.then(() => {
// graphql-yoga@^3.6.0 requires graphql@>=15.2.0
if (semver.satisfies(version, '>=15.2.0')) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to add this without that many changes to the file?

@khanayan123
khanayan123 requested review from Qard and rochdev September 11, 2023 20:42
@khanayan123
khanayan123 force-pushed the khanayan123/add-instrumentation-for-graphql-yogav3 branch from 3014b37 to 3cb75df Compare September 12, 2023 17:37

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this test removal more? At first glance it looks like this PR breaks support for apollo-server-core.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also call .skip on the test instead of commenting it out.

@khanayan123 khanayan123 Sep 13, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlhunter

The precense of graphql@^15.2.0 in the /versions folder causes [email protected]
to break in the before() hook. This test tests a library version that had its release occur 5 years ago &
updating the test would require using newer version of apollo-core which have a completely different syntax
and produces traces that are different then what is expected by this test

@khanayan123
khanayan123 force-pushed the khanayan123/add-instrumentation-for-graphql-yogav3 branch from a6aef7c to 1e1771c Compare September 13, 2023 13:44
@khanayan123
khanayan123 force-pushed the khanayan123/add-instrumentation-for-graphql-yogav3 branch from 5398b01 to fdab068 Compare September 22, 2023 20:49
@khanayan123
khanayan123 merged commit ed839d9 into master Sep 25, 2023
@khanayan123 khanayan123 mentioned this pull request Sep 26, 2023
@khanayan123 khanayan123 mentioned this pull request Sep 26, 2023
khanayan123 added a commit that referenced this pull request Sep 26, 2023
* add support for graphql-yoga v3 executor
khanayan123 added a commit that referenced this pull request Sep 26, 2023
* add support for graphql-yoga v3 executor
khanayan123 added a commit that referenced this pull request Sep 27, 2023
* add support for graphql-yoga v3 executor
khanayan123 added a commit that referenced this pull request Sep 27, 2023
* add support for graphql-yoga v3 executor
@tlhunter
tlhunter deleted the khanayan123/add-instrumentation-for-graphql-yogav3 branch January 19, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants