Since the mutation input is in JSON format which doesn’t differentiate between INT/FLOAT (everything is a number), the server gets a float and stores the facet as such. This is, unfortunately, a limitation of the JSON format and the fact that facets don’t have a fixed type.
I would recommend setting a property on a node (instead of facet) if the type is important to you or using the RDF mutation format.
This seems like a more general problem affecting node predicates as well. It seems at the moment, the only choices are:
use mutation JSON, in which case I can’t get my integers back out of the database, because they get converted to floats during unmarshalling
Use NQuads and construct them myself.
In my use case, I have dynamic data, and I don’t know what it looks like ahead of time, so I cannot unmarshal into a predefined struct.
I think a modified json.Unmarshaler which does not coerce ints might be helpful. Perhaps the standard lib code could be repurposed and modified relatively easily…
on second thought, anything that traverses the wire as JSON isn’t going to work. Maybe then, some helper methods to construct the relevant NQuads from the users structs or proto.Messages?