Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL plugins does not hook correctly. #172

Closed
quentin- opened this issue Jul 7, 2018 · 1 comment
Closed

GraphQL plugins does not hook correctly. #172

quentin- opened this issue Jul 7, 2018 · 1 comment
Labels
bug Something isn't working community core

Comments

@quentin-
Copy link

quentin- commented Jul 7, 2018

馃憢,

Unless i'm mistaking, the following should work:

yarn init
yarn add dd-trace@0.3.1 graphql@0.13.2
// index.js
const tracer = require('dd-trace').init({ debug: true });
const graphql = require('graphql');

// Instrumented module "graphql/language/parser.js" was imported before calling tracer.init(). Please make sure to initialize the tracer before importing any instrumented module.
// Instrumented module "graphql/execution/execute.js" was imported before calling tracer.init(). Please make sure to initialize the tracer before importing any instrumented module.

node 8.9.4

edit: it actually hooked correctly despite the warnings, execution was failing because of #173

@rochdev rochdev added bug Something isn't working core community labels Jul 9, 2018
@rochdev
Copy link
Member

rochdev commented Jul 9, 2018

This seems to be related to the fact that the module is required in require-in-the-middle before the plugin is patched. While this is the expected behavior, the current validation assumes this is not the case, causing the warning. You can safely ignore the warning for now, and this will be fixed in a future version by putting the validation earlier in the initialization process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community core
Projects
None yet
Development

No branches or pull requests

2 participants