Skip to content

Commit 602e1f9

Browse files
committed
Added documentation for exclude_fields
as a method of limiting field access DjangoObjectType
1 parent 5d6c7f2 commit 602e1f9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/authorization.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ This is easy, simply use the ``only_fields`` meta attribute.
3434
only_fields = ('title', 'content')
3535
interfaces = (relay.Node, )
3636
37+
conversely you can use ``exclude_fields`` meta atrribute
38+
39+
.. code:: python
40+
41+
from graphene import relay
42+
from graphene_django.types import DjangoObjectType
43+
from .models import Post
44+
45+
class PostNode(DjangoObjectType):
46+
class Meta:
47+
model = Post
48+
exclude_fields = ('published', 'owner')
49+
interfaces = (relay.Node, )
50+
3751
Queryset Filtering On Lists
3852
---------------------------
3953

0 commit comments

Comments
 (0)