Skip to content

Add execution path information to Info variable #148

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

Merged
merged 12 commits into from
Jan 21, 2018

Conversation

ekampf
Copy link
Contributor

@ekampf ekampf commented Oct 31, 2017

  • Added path variable to ResolveInfo to be used for tracing and error information
  • Added extensions to ExecutionResult to allow adding extension data to graphql results

The path information. is useful for implementing Tracing (in a separate PR under graphql-server-core) and better error information as specified in issues #127 and #131

@ekampf ekampf force-pushed the feature/tracing_support branch from 294ea9b to 1ef9cd3 Compare October 31, 2017 22:34
@ekampf ekampf changed the title Feature/tracing support Feature/tracing support (Work In Progress) Oct 31, 2017
@ekampf ekampf changed the title Feature/tracing support (Work In Progress) Add execution path information to Info variable Nov 1, 2017
@ekampf ekampf force-pushed the feature/tracing_support branch from 545e1e6 to e5f52ab Compare November 1, 2017 17:37
@ekampf ekampf force-pushed the feature/tracing_support branch from e5f52ab to c67320c Compare November 1, 2017 17:47
@ekampf
Copy link
Contributor Author

ekampf commented Nov 1, 2017

@syrusakbary I think this is ready for your review

@ekampf
Copy link
Contributor Author

ekampf commented Nov 13, 2017

@syrusakbary ?

Copy link

@brentmclark brentmclark left a comment

Choose a reason for hiding this comment

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

Looks great, and nice work on the test!

@pobed2
Copy link

pobed2 commented Jan 8, 2018

This is awesome, @ekampf! @syrusakbary, any thoughts on merging this PR?

@ekampf
Copy link
Contributor Author

ekampf commented Jan 8, 2018

@syrusakbary ping

@syrusakbary
Copy link
Member

The PR looks great! I'm a bit worried about the performance in big outputs, but I guess is better try and see :)

@syrusakbary syrusakbary merged commit b3a6bd0 into graphql-python:master Jan 21, 2018
@ekampf
Copy link
Contributor Author

ekampf commented Jan 30, 2018

yey! :)

@bryanhelmig bryanhelmig mentioned this pull request Apr 20, 2018
@joealcorn
Copy link

joealcorn commented May 15, 2018

@ekampf thanks for this, and to @syrusakbary & @brentmclark too of course!

I see you implemented a TracingMiddleware but reverted it before the merge. I've got a fork here with that functionality re-instated as it hasn't been added to graphql-server-core yet, but I'm interested in doing so.

If possible I'd like to get a bit of background on graphql-server-core. How all the different packages interact is something that has taken me a while to figure out. I'm using graphene 2.0.1, graphene-django 2.0 and graphql-core 2.0.1, but as far as I can tell graphql-server-core is not used. Does anybody have an insight into how it fits in here?

@olasitarska
Copy link

@joealcorn just came across an exact same question after few hours of digging around and trying to figure out which package does what :) Looks like we're trying to do the same thing, and came to the same conclusions. Let me know if you need any help and I'd be quite happy to collaborate on this!

@ekampf
Copy link
Contributor Author

ekampf commented May 17, 2018

@joealcorn @olasitarska to my understanding, graphql-core deals with parsing and executing GraphQL queries, while graphql-server-core deals with exposing that functionality under http.
It seemed more logical to me to have the TracingMiddleware there..
Here's an unfinished PR you're welcome to help test - https://github.com/ekampf/graphql-server-core/tree/feature/tracing

@joealcorn
Copy link

joealcorn commented May 21, 2018

I have no numbers, but I would hazard a guess that many (most?) people using graphql-core are using django & graphene-django who won't be able to benefit from this (as it doesn't appear to use graphql-server-core).

Perhaps the tracing middleware could be extracted to a separate library and installed alongside grapqhl-core as an extra? Like pip install graphql-core[tracing]

In the meantime my fork appears to work well (seems to be reporting correctly at least) which uses your work @ekampf

@ekampf ekampf deleted the feature/tracing_support branch May 29, 2018 17:02
@ekampf
Copy link
Contributor Author

ekampf commented May 29, 2018

@joealcorn why not have graphene-django use graphql-server-core ?
For starters it can just import the middleware from it and use it in GraphQLView but I think on the longer term, GraphQLView is largely a duplication of server-core's function (even has the same function names) so it would be ideal to de-duplicate that code...

Did you use the tracing middleware with Apollo Optics? it works?

@joealcorn
Copy link

why not have graphene-django use graphql-server-core ?

I assume that's the long term plan and probably a good direction to go. If memory serves I'm stuck on an old version of graphene/graphene-django for a while (old django version) so that may not work for me just yet.

Did you use the tracing middleware with Apollo Optics? it works?

Yes, it seems to work fine with apollo engine (formerly optics). I had to make some small tweaks (like changing from ms to ns)

Here's a screenie of the trace view working:

screen shot 2018-06-01 at 14 53 59

@ekampf
Copy link
Contributor Author

ekampf commented Jun 2, 2018

@joealcorn woa! awesome!
can you PR your changes into my branch and then lets submit a PR to the main library?

@joealcorn
Copy link

@ekampf Good idea, I will get on that later this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants