Skip to content

Instantly share code, notes, and snippets.

@alexanderhupfer
Last active April 5, 2021 19:47
Show Gist options
  • Save alexanderhupfer/e6f20c826b3217f595f0b9024515e9dc to your computer and use it in GitHub Desktop.
Save alexanderhupfer/e6f20c826b3217f595f0b9024515e9dc to your computer and use it in GitHub Desktop.
def resolve_user_configuration(*args, **kwargs):
configuration = get_user_configuration(user_id)
result = {
'enabled' : configuration.enabled,
'value' : configuration.value,
'id': configuration.id
}
return result
class User(SQLAlchemyObjectType):
class Meta:
model = UserModel
# New:
configuration = graphene.Field(lambda: Confguration)
def resolve_configuration(self, info, **kwargs):
return resolve_user_configuration(user_id=self.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment