For instance:
# types
...
class CategoryType(DjangoObjectType):
class Meta:
model = Brand
fields = ("name", "detail")
class BookType(DjangoObjectType):
class Meta:
model = Book
fields = ("title", "category", "other_fields")
# queries
...
class CategoriesQuery(graphene.ObjectType):
categories = graphene.List(CategoryType)
@staticmethod
def resolve_category_list(root, info):
return Category.objects.all()
class BooksQuery(graphene.ObjectType):
books= graphene.List(BookType)
@staticmethod
def resolve_book_list(root, info):
return Book.objects.all()
How can I exclude detail field querying book list,
without excluding in CategoryType itself (which may be used in other queries like category list)?