I have a graphene-django GraphQL API that I've added custom directives and middleware in that are very similar to what's offered by graphene-django-extras. There are several places where enum types are returned as a graphene.Int() field, I'd like to be able to use a directive to transform that a graphene.String() but it doesn't do that on its own. eg.
{
foo {
bar # return Int
# vs
bar @readable # return String
}
}
Is that even possible? I'm looking through the ResolvInfo fields and there is something for the return type, but initial attempts don't work.
Edit: FWIW I don't think it matters that the API is currently developed using Python and Graphene. The question is more about whether or not GraphQL even supports this, I assume that if it does not then no language or library would make it possible.