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
Never expose all model fields by default — explicitly whitelist fields:
class UserType(DjangoObjectType):
class Meta:
model = User
# GOOD: explicit whitelist
fields = ("id", "username", "email", "date_joined")
# BAD: exposes everything including password hashes, tokens, etc.
# fields = "__all__"
# ALTERNATIVE: exclude sensitive fields (less safe — new fields auto-exposed)
# exclude = ("password", "last_login", "is_superuser")
Rule: Always use fields (whitelist), never fields = "__all__". The exclude approach is fragile — new model fields are exposed automatically.
class BookType(DjangoObjectType):
class Meta:
model = Book
fields = ("id", "title", "author", "isbn", "old_slug")
description = "A published book in the catalog."
# Deprecate fields instead of removing (backwards compatibility)
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.