MCPcopy
hub / github.com/dgraph-io/dgraph / ValFor

Function ValFor

types/facets/utils.go:177–185  ·  view source on GitHub ↗

ValFor converts Facet into types.Val.

(f *api.Facet)

Source from the content-addressed store, hash-verified

175
176// ValFor converts Facet into types.Val.
177func ValFor(f *api.Facet) (types.Val, error) {
178 val := types.Val{Tid: types.BinaryID, Value: f.Value}
179 facetTid, err := TypeIDFor(f)
180 if err != nil {
181 return types.Val{}, err
182 }
183
184 return types.Convert(val, facetTid)
185}

Callers 7

validateAndConvertFacetsFunction · 0.92
facetToStringFunction · 0.92
applyFacetsTreeFunction · 0.92
getCostMethod · 0.92
populateFacetVarsMethod · 0.92
attachFacetsMethod · 0.92

Calls 2

ConvertFunction · 0.92
TypeIDForFunction · 0.85

Tested by

no test coverage detected