MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / makeUidNode

Method makeUidNode

query/outputnode.go:231–242  ·  view source on GitHub ↗
(attr uint16, uid uint64)

Source from the content-addressed store, hash-verified

229}
230
231func (enc *encoder) makeUidNode(attr uint16, uid uint64) (*node, error) {
232 fj := enc.newNode(attr)
233 fj.meta |= uidNodeBit
234
235 var tmp [8]byte
236 binary.BigEndian.PutUint64(tmp[:], uid)
237
238 if err := enc.setScalarVal(fj, tmp[:]); err != nil {
239 return nil, err
240 }
241 return fj, nil
242}
243
244// makeCustomNode returns a fastJsonNode that stores the given val for a @custom GraphQL field.
245func (enc *encoder) makeCustomNode(attr uint16, val []byte) (fastJsonNode, error) {

Callers 1

SetUIDMethod · 0.95

Calls 2

newNodeMethod · 0.95
setScalarValMethod · 0.95

Tested by

no test coverage detected