106 points · by syrusakbary · 10y ago · 25 comments
Please guys, give us an explanation on the front page of what the hell it is (in a meaningful non-generic way) and why we would want to use it.
As a side note, a better approach for handling errors is coming to graphene soon
I understand it's a caching problem which is hard (I know that joke), but I'm wondering specifically how it's handled with a graph query.
The way I've been doing it is using a SQL structured on the front-end and downloading the main table/rows + changes. But graphql seems to be downloading and aggressively caching without keeping track of timestamp.
Sometimes the types could be defined after the class definition. In this case, you can use strings for reference field types. Something like:
class User(graphene.ObjectType): friends = graphene.Field('self') # 'User' would work too.
class User(graphene.ObjectType):
name = graphene.String()
initials = graphene.String()
def resolve_name(self, args, info):
return user_service.lookup_name(...)
def resolve_initials(self, args, info):
# How can I refer to the result of resolve_name above?
return ''.join(part for part in name.split(' '))
Perhaps I'm not using graphene in the way it was intended to be used?