Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

resolve time info in graphiql #1161

Unanswered
gwaihir8 asked this question in Q&A
Discussion options

Hi, thanks for creating this great module!

I'm working on a quite big project for a client, and certain big graphql queries start taking up quite some time.
That's why i'm looking into performance monitoring of my queries. I found the graphiql-debug-toolbar, but that is only giving me insight in the number of sql database hits.

two things:

  • many of my resolver functions need to fetch data from an external time series database, which takes a bit of time. It would be nice to monitor how many calls to this external database were made.
  • i would like to monitor the total time each resolver took while executing its function. It would be nice to return that as debug info, or inject it as comments in the query field of graphiql (if that is possible somehow).

Does anybody know how i could start developing such functionality, using middleware or ... ?

thanks!

You must be logged in to vote

Replies: 1 comment

Comment options

One strategy for v3 would be to extend the ExecutionContext: https://github.com/graphql-python/graphql-core/blob/master/src/graphql/execution/execute.py You could wrap execute_operation to collect timing stats from services.

Whether it's a custom execution context class or graphql middleware, the standard graphql view accepts either as arguments.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1097 on April 14, 2021 20:00.

AltStyle によって変換されたページ (->オリジナル) /