mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-01-30 19:24:08 +03:00
Added documentation for exclude_fields
as a method of limiting field access DjangoObjectType
This commit is contained in:
parent
5d6c7f2dc3
commit
602e1f9de1
|
@ -34,6 +34,20 @@ This is easy, simply use the ``only_fields`` meta attribute.
|
||||||
only_fields = ('title', 'content')
|
only_fields = ('title', 'content')
|
||||||
interfaces = (relay.Node, )
|
interfaces = (relay.Node, )
|
||||||
|
|
||||||
|
conversely you can use ``exclude_fields`` meta atrribute
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
from graphene import relay
|
||||||
|
from graphene_django.types import DjangoObjectType
|
||||||
|
from .models import Post
|
||||||
|
|
||||||
|
class PostNode(DjangoObjectType):
|
||||||
|
class Meta:
|
||||||
|
model = Post
|
||||||
|
exclude_fields = ('published', 'owner')
|
||||||
|
interfaces = (relay.Node, )
|
||||||
|
|
||||||
Queryset Filtering On Lists
|
Queryset Filtering On Lists
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user