From 9f36e35be688f2eeeefdaeb58bd9efc7dd89fe81 Mon Sep 17 00:00:00 2001 From: Clemens Tolboom Date: Thu, 17 Oct 2019 09:13:40 +0200 Subject: [PATCH 1/2] ValueError: The options 'only_fields' and 'exclude_fields' cannot be both set on the same type. Not sure what to choose I removed both as these do not help for the example imho. See https://github.com/graphql-python/graphene-sqlalchemy/blob/0544f812b37f8e6b49ed3363e7010c08a600be1d/graphene_sqlalchemy/types.py#L237 --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 2ba0d1cb..da0e8d99 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,6 @@ from graphene_sqlalchemy import SQLAlchemyObjectType class User(SQLAlchemyObjectType): class Meta: model = UserModel - # only return specified fields - only_fields = ("name",) - # exclude specified fields - exclude_fields = ("last_name",) class Query(graphene.ObjectType): users = graphene.List(User) From 033f76f724201c5bcd701fd4d18008ffa74d43c9 Mon Sep 17 00:00:00 2001 From: Clemens Tolboom Date: Wed, 23 Oct 2019 17:10:52 +0200 Subject: [PATCH 2/2] Add examples back and rephrase comments --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index da0e8d99..9b617069 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,10 @@ from graphene_sqlalchemy import SQLAlchemyObjectType class User(SQLAlchemyObjectType): class Meta: model = UserModel + # use `only_fields` to only expose specific fields ie "name" + # only_fields = ("name",) + # use `exclude_fields` to exclude specific fields ie "last_name" + # exclude_fields = ("last_name",) class Query(graphene.ObjectType): users = graphene.List(User)