def __call__(self, implementation): if isclass(implementation): self._implementation = implementation() else: self._implementation = implementation SchemaRegistry.register_scalar(self._schema_name, self) return implementation
def __call__(self, implementation: Any) -> Any: """ Registers the scalar into the schema. :param implementation: implementation of the scalar :type implementation: Any :return: the implementation of the scalar :rtype: Any """ if isclass(implementation): self._implementation = implementation() else: self._implementation = implementation SchemaRegistry.register_scalar(self._schema_name, self) return implementation
def __call__(self, implementation): SchemaRegistry.register_scalar(self._schema_name, self) self._implementation = implementation return implementation