INNER CODE UNIT · Python

binary_to_string

eamigo86/graphene-django-extras · graphene_django_extras/base_types.py:144

    def binary_to_string(value):
        """Convert binary data to string representation."""
        return binascii.hexlify(value).decode("utf-8")

    serialize = binary_to_string
    parse_value = binary_to_string

    @classmethod
    def parse_literal(cls, node):
        """Parse literal node from GraphQL AST."""
        if isinstance(node, ast.StringValue):
            return cls.binary_to_string(node.value)


class CustomDateFormat(object):
    """Custom date format wrapper."""

    def __init__(self, date):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…