Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides Graphene-Django guidance for GraphQL APIs on N+1 prevention, query optimization, schema design, security, caching, and testing.
Use this skill ↓92% 92%0 ptsof test cases passed
Passed 23 of 25 test cases with the skill, and 23 of 25 without it.
3 of 3 safety checks passed
Not used yet
Introspection exposes your entire schema — types, fields, arguments, deprecations. Disable it in production.
# settings.py
GRAPHENE = {
"SCHEMA": "myapp.schema.schema",
"MIDDLEWARE": ["myapp.middleware.AuthMiddleware"],
}
# In your view — disable introspection for non-staff
from graphene_django.views import GraphQLView
class SecureGraphQLView(GraphQLView):
def execute_graphql_request(self, request, data, query, *args, **kwargs):
# Block introspection queries in production
if query and "__schema" in query and not request.user.is_staff:
from graphql import GraphQLError
raise GraphQLError("Introspection is disabled.")
return super().execute_graphql_request(request, data, query, *args, **kwargs)
from graphql import GraphQLError
from graphql.validation import ASTValidationRule
from graphql.language import FieldNode
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.