Skip to content

Implement mgp object serialization #313

Description

@katarinasupe

It would be useful if all objects from mgp are JSON serializable, that is, that there is some kind of method that returns Python Dict of mgp objects. For example, when I'm writing a query module for database export, I'm actually creating a JSON file with a list of nodes and relationships. Therefore, I have to reach every label, property, etc. of each Vertex and Edge. I would like to be able to just add properties as a list to my properties key, but then mgp.Vertex.properties is not JSON serializable. I solved this by going through all properties and creating new dictionary, but I think that the right place for this code would be inside mgp and not query module. Since we're going to create new utility modules similar to the export one, this feature may come in handy.

Activity

  1. gitbuda commented on Aug 1, 2022

    @gitbuda
    Member

    Since we added the support for functions, there are more places where this type of functionality can fit:

  2. self-assigned this
    on Nov 17, 2022
  3. C-you-know commented on Apr 14, 2026

    @C-you-know

    Hey @katarinasupe, would you mind taking a look at this PR when you get a chance?

  4. added a commit that references this issue on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions