-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL Blocking #3819
GraphQL Blocking #3819
Conversation
Overall package sizeSelf size: 5.77 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3819 +/- ##
==========================================
- Coverage 85.14% 84.56% -0.59%
==========================================
Files 228 233 +5
Lines 9345 9711 +366
Branches 33 33
==========================================
+ Hits 7957 8212 +255
- Misses 1388 1499 +111 ☔ View full report in Codecov by Sentry. |
BenchmarksBenchmark execution time: 2023-12-19 15:45:42 Comparing candidate commit 8f427dc in PR branch Found 1 performance improvements and 1 performance regressions! Performance is the same for 519 metrics, 11 unstable metrics. scenario:log-skip-log-16
scenario:plugin-graphql-with-depth-off-18
|
…js into julio/graphql-blocking
…js into julio/graphql-blocking
* Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf.
This reduces the performance overhead due to just one instance is shared across the whole query exectution.
…js into julio/graphql-blocking
…js into julio/graphql-blocking
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
* Upload module skeleton. * Blocking in apollo, very very first version * Move graphql implementation to another module. * Blocking for apollo-server-core, ugly but it works, lets find a better way * Use real blocking data * Set blocking to true. * Throw before resolver execution in order to stop the operation's execution flow. * Use HttpQueryError in apollo-server-core * Blocking test in apollo-server-fastify * Refactor graphql blocking. * Remove previous implementation which only supported monitoring. * Add new waf address in order to check the payload of every resolver. * Use apm start resolver address instead of a new one. * Remove mock and perform an actual call to the waf. * Add non blocking graphql test * Move abortController constructor to context creation. This reduces the performance overhead due to just one instance is shared across the whole query exectution. * Add pollo-server-express block tests * Add unit tests. * Add @apollo/server tests * Update test rules for blocking by `graphql.server.resolver` * Block with graphql templates data * Add tests. * Block with graphql data in graphql endpoint * Fix tests. * Execute @apollo/server and apollo-server-express tests * Unify code in @apollo/server and apollo-server-core * update comments * Add appsec.blocked tag in blocked requests * Add test with non graphql block response * Tests for block with redirect * Prevent creation of resolve span when it is blocked before the execution of the resolve code * Refactor addResolver in order to get directives information. * Add tests to block on directives. * Add test for directives. * Undo prevent creating resolve span * Configurable graphql blocking json * Refactor graphql * Using resolver instead of resolvers. * Change graphql channel name to be consistent with the others. * Small changes in blocking * Move resover information resolution to plugin. * Revert "Move resover information resolution to plugin." This reverts commit 7cc8561. * Remove resolver information from context, pass it in a different field instead. * Throw custom exception rather than send an empty array. * Update packages/datadog-instrumentations/src/graphql.js Co-authored-by: Ugaitz Urien <[email protected]> * Change a bit apollo-server-core instrumentation * Protect Header map, if in future version it is moved/removed, prevent breaks * Remove some duplicated code * Update packages/datadog-instrumentations/src/apollo-server.js Co-authored-by: Carles Capell <[email protected]> * Fix comments in the PR * Fix PR comments. * Fix some comments in the PR * Move resolver information formatting to the plugin. * Fix PR comments. * Fix proper use of Promise.race. --------- Co-authored-by: Ugaitz Urien <[email protected]> Co-authored-by: Carles Capell <[email protected]>
} else { | ||
resolvers[info.fieldName] = [] | ||
const directives = info.fieldNodes[0].directives | ||
for (const directive of directives) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is breaking to me.
I am using KeystoneJS and the schema generated is not returning directives
sometimes.
For example:
🚀 ~ getResolverInfo ~ info.fieldNodes[0]: {
kind: 'Field',
name: { kind: 'Name', value: 'user' },
arguments: [ { kind: 'Argument', name: [Object], value: [Object] } ],
selectionSet: {
kind: 'SelectionSet',
selections: [ [Object], [Object], [Object] ],
loc: Location {
start: 19,
end: 108,
startToken: [Token],
endToken: [Token],
source: [Source]
}
}
}
Of course, the error I am getting is: TypeError: directives is not iterable
.
Should we validate if directives
is effectively iterable before the for
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll investigate and fix this bug as fast as possible. Thank you for reporting the issue!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow perfect, I was about to create one too. Thank you for being proactive and let's continue this discussion there.
What does this PR do?
This PR adds blocking capabilities to GraphQL operations. In order to do that the instrumentation gets every resolver and directive information, format it and publish it. Then this information is handled in the proper Appsec module so it can be analyzed. In the event that the operation contains an attack an abort controller is signaled which will throw an custom exception which, in turn, prevent the current and coming resolvers from being executed. The aforementioned exception is later caught just to finalize the spans properly.
Motivation
Add threat protection to GraphQL operations.
Additional Notes
APM files added/modified:
APPSEC-12041