Skip to content

Conversation

@fragglebob
Copy link
Contributor

This PR fixes the graphql integration stoping a type being instrumented more than once, for allowing recursive types and will now instrument resolvers on types within lists.

if (field.type && field.type._fields) {
wrapFields(field.type._fields, tracer, config, responsePathAsArray)

if (field.type && !field.type._datadog_patched) {
Copy link
Member

Choose a reason for hiding this comment

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

The _datadog_patched property should be on the resolve function directly. This will avoid the same issue when a function is shared between 2 types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, _datadog_patched would never get set on something like a list so is a pointless check here. Though isn't it needed on the type to stop recursion.

Copy link
Member

Choose a reason for hiding this comment

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

You're right that this may be a problem. Would you be able to write a test case for this issue? Or did it end up being a non-issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a recursive type to the test schema, so because the tests are passing its working. But a dedicated test would be much better.

@rochdev
Copy link
Member

rochdev commented Jul 5, 2018

The tests are a bit flaky at the moment. I'll rerun any build that fails because of that.

@rochdev rochdev merged commit a18ca6b into DataDog:master Jul 9, 2018
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 this pull request may close these issues.

2 participants