Graphene resolver for an object that has no model

Viewed 5442

I'm trying to write a resolver that returns an object created by a function. It gets the data from memcached, so there is no actual model I can tie it to.

I think my main issue is I can't figure out what type to use and how to set it up. I'm using this in conjunction with Django, but I don't think it's a django issue (afaict). Here's my code so far:

class TextLogErrorGraph(DjangoObjectType):

    def bug_suggestions_resolver(root, args, context, info):
        from treeherder.model import error_summary
        return error_summary.bug_suggestions_line(root)

    bug_suggestions = graphene.Field(TypeForAnObjectHere, resolver=bug_suggestions_resolver)

Notice I don't know what type or field to use. Can someone help me? :)

1 Answers
Related