Last active
April 5, 2021 19:47
-
-
Save alexanderhupfer/e6f20c826b3217f595f0b9024515e9dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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