Created
February 5, 2020 14:20
-
-
Save shaungehring/8482b87209c053335178230175523c05 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
@dataclass | |
class BoundaryGeneric: | |
def __init__(self, child_name, kwargs=None): | |
self.typename = child_name | |
if kwargs: | |
self.update_class(kwargs) | |
self.get_updated() | |
def update_class(self, kwargs): | |
for k, v in kwargs.items(): | |
if not hasattr(self, k): | |
setattr(self, k, v) | |
def get_updated(self): | |
return self | |
""" | |
Dataclasses, These need to be defined for Boundry Types (A GraphQL type from another server that you are Extending | |
""" | |
@dataclass | |
class User(BoundaryGeneric): | |
def __init__(self, **kwargs): | |
super().__init__(self.__class__.__name__, kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment