Skip to content

Best way to serialize "bytea" field? #230

@vaskokj

Description

@vaskokj

I have a bytea field in a postgresql database. In my SQLAlchemy model it is defined as the following.

checksum_sha256 = Column(LargeBinary, nullable=False, unique=True)

When I query for this in graphiQL the server side throw the error.

TypeError: Object of type 'bytes' is not JSON serializable

This is a pretty obvious solution as it can't serialize the data. Is there any way to handle this appropriately?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions