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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphql plugin doesn't work with apollo schema stitching #235

Closed
Alfarlost opened this issue Aug 15, 2018 · 3 comments · Fixed by #323
Closed

Graphql plugin doesn't work with apollo schema stitching #235

Alfarlost opened this issue Aug 15, 2018 · 3 comments · Fixed by #323
Labels
bug Something isn't working community integrations
Milestone

Comments

@Alfarlost
Copy link

I'm using apollo schema stitching and receive next error:

TypeError: Cannot redefine property: _datadog_operation
    at Function.defineProperties (<anonymous>)
    at Object.executeWithTrace (/home/node/node_modules/dd-trace/src/plugins/graphql.js:29:14)
    at /home/node/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:84:52
    at step (/home/node/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:32:23)
    at Object.next (/home/node/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:13:53)
    at /home/node/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/home/node/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:3:12)
    at delegateToSchemaImplementation (/home/node/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:57:12)
    at Object.delegateToSchema [as default] (/home/node/node_modules/graphql-tools/dist/stitching/delegateToSchema.js:53:12)

I wonder if just adding writable: true to line 29 defineProperties will be enough.

@rochdev
Copy link
Member

rochdev commented Aug 15, 2018

This means that execute is called multiple times with the same contextValue. To my knowledge this was not possible but maybe schema stitching does that.

I'm not very familiar with schema stitching. Can you share the snippet (or equivalent) resulting in this error?

@rochdev rochdev added bug Something isn't working community integrations labels Aug 15, 2018
@Alfarlost
Copy link
Author

Alfarlost commented Aug 15, 2018

@rochdev, you can use the full example described in official docs
https://www.apollographql.com/docs/graphql-tools/schema-stitching.html
Just checked, it throws the same error.
Please, use the full example with resolvers between schemas.

@rochdev
Copy link
Member

rochdev commented Aug 15, 2018

Thanks for the reference! I'll take a look.

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 integrations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants