Skip to content

New JSON facets response format cannot be unserialized back into client structures #4798

@mehdiym

Description

@mehdiym

What version of Dgraph are you using?

1.2.1

Steps to reproduce the issue (command/config used to run Dgraph).

Query for UID facets, and then try to unmarshal them into a Go struct.

Expected behaviour and actual result.

Expected: Facet values properly set.
Actual: Zero values.

I realize the facets response format has recently changed, but I don't understand how I can now unserialize it into my data structures : facets are now independent objects attached to the parent node while my Go facet properties are defined into the child node.

In the go doc example, the result is not unserialized into a Person anymore but instead into a generic json.RawMessage: does it mean it is not possible anymore?

How can I get facets directly back into my data structures?

Metadata

Metadata

Labels

area/facetsIssues related to face handling, querying, etc.kind/bugSomething is broken.status/acceptedWe accept to investigate/work on it.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions