From a10e6ef350cb64a147bf334159ba335b5494088f Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Thu, 8 Aug 2019 23:04:45 +0500 Subject: [PATCH] Use field and exclude in docs instead deprecated attrs --- docs/authorization.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/authorization.rst b/docs/authorization.rst index 2c38fa4..39dc9d1 100644 --- a/docs/authorization.rst +++ b/docs/authorization.rst @@ -20,7 +20,7 @@ Let's use a simple example model. Limiting Field Access --------------------- -To limit fields in a GraphQL query simply use the ``only_fields`` meta attribute. +To limit fields in a GraphQL query simply use the ``fields`` meta attribute. .. code:: python @@ -31,10 +31,10 @@ To limit fields in a GraphQL query simply use the ``only_fields`` meta attribute class PostNode(DjangoObjectType): class Meta: model = Post - only_fields = ('title', 'content') + fields = ('title', 'content') interfaces = (relay.Node, ) -conversely you can use ``exclude_fields`` meta attribute. +conversely you can use ``exclude`` meta attribute. .. code:: python @@ -45,7 +45,7 @@ conversely you can use ``exclude_fields`` meta attribute. class PostNode(DjangoObjectType): class Meta: model = Post - exclude_fields = ('published', 'owner') + exclude = ('published', 'owner') interfaces = (relay.Node, ) Queryset Filtering On Lists @@ -133,7 +133,7 @@ method to your ``DjangoObjectType``. class PostNode(DjangoObjectType): class Meta: model = Post - only_fields = ('title', 'content') + fields = ('title', 'content') interfaces = (relay.Node, ) @classmethod