Skip to content

Commit f3d9cbc

Browse files
authored
Merge pull request #109 from BossGrand/master
Added documentations for limiting field access using exclude_fields...
2 parents 441dde4 + 84a0742 commit f3d9cbc

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)