Open ShivanshJ opened 3 years ago
I try to include relay connection like this.
class PostObject(SQLAlchemyObjectType):
class Meta:
model = Post
interfaces = (graphene.relay.Node, )
class ProtectedPost(graphene.Union):
class Meta:
types = (PostObject, AuthInfoField)
class PostConnection(graphene.Connection):
class Meta:
node = ProtectedPost
class Query(graphene.ObjectType):
node = graphene.relay.Node.Field()
my_posts = graphene.ConnectionField(PostConnection)
However, I get an error when the "token" expires. error is -
Resolved value from the connection field have to be iterable or instance of PostConnection. Received "<flask_graphql_auth.fields.AuthInfoField object at 0x10c34e160>"
This is because AuthInfoField
returns an Object Literal whereas IterableConnection
expects an Iterable list.
Throwing an Exception or GraphQL error should solve so many complications.
AuthInfoField makes things complex especially if you use Relay. A lot of errors of the type : Object doesn't match crop up.
Can the error simply be a graphQLError ? (from the library
graphql.error.base import GraphQLError
)