About Debugging SQL Queries in GraphQL with Graphene-Django
You can inspect the Graphene-Django database queries and their execution time using the graphene_django.debug.DjangoDebugMiddleware
. Note, that this is not a Django middleware, and it must be placed in the GRAPHENE
settings in your settings file:
1 2 3 4 5 6 |
|
In your schema.py
file, add a custom field "_debug" which will return meaningful info only if the middleware is activated:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Query the debug info as the last field, as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Tips and Tricks Programming Databases Debugging Django 5.x Django 4.2 Django 3.2 Graphene-Django GraphQL
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.