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

fix graphql integration not working when using schema stitching #323

Merged
merged 2 commits into from
Oct 21, 2018

Conversation

rochdev
Copy link
Member

@rochdev rochdev commented Oct 19, 2018

This PR fixes the graphql integration not working when using schema stitching. This is a feature of Apollo Server that allows merging multiple schemas together.

This was not working before because the instrumentation was storing metadata on the schema and the contextValue with the assumption that there is only one of each for every operation. Now all metadata is properly attached to the operation itself and is thus independent from the number of schemas or changes to contextValue.

Fixes #235 #307

@rochdev rochdev added bug Something isn't working integrations labels Oct 19, 2018
@rochdev rochdev added this to the 0.6.1 milestone Oct 19, 2018
Copy link

@tylerbenson tylerbenson left a comment

Choose a reason for hiding this comment

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

You should consider writing a test library to make your trace testing more declarative like Java.

@rochdev
Copy link
Member Author

rochdev commented Oct 21, 2018

@tylerbenson Thanks for the suggestion! Do you have any ideas for the syntax of the test helper?

@rochdev rochdev merged commit f638dd6 into master Oct 21, 2018
@rochdev rochdev deleted the apollo-server branch October 21, 2018 14:59
@tylerbenson
Copy link

@rochdev not really in particular. Perhaps some sort of JSON like document structure? That's kind of what ours looks like.

@rochdev
Copy link
Member Author

rochdev commented Oct 22, 2018

@tylerbenson I guess it could already be done with deep.equal.

For example:

expect(span).to.deep.equal({
  service: 'test',
  resource: 'GET /user/:id',
  meta: {
    'http.url': 'http://localhost/user/123'
  }
})

I actually don't know why I haven't been using that for all tests (some do).

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

Successfully merging this pull request may close these issues.

Graphql plugin doesn't work with apollo schema stitching
2 participants