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

Function writeUIDFunc

graphql/dgraph/graphquery.go:126–146  ·  view source on GitHub ↗
(b *strings.Builder, uids []uint64, args []dql.Arg)

Source from the content-addressed store, hash-verified

124}
125
126func writeUIDFunc(b *strings.Builder, uids []uint64, args []dql.Arg) {
127 x.Check2(b.WriteString("uid("))
128 if len(uids) > 0 {
129 // uid function with uint64 - uid(0x123, 0x456, ...)
130 for i, uid := range uids {
131 if i != 0 {
132 x.Check2(b.WriteString(", "))
133 }
134 x.Check2(b.WriteString(fmt.Sprintf("%#x", uid)))
135 }
136 } else {
137 // uid function with a Dgraph query variable - uid(Post1)
138 for i, arg := range args {
139 if i != 0 {
140 x.Check2(b.WriteString(", "))
141 }
142 x.Check2(b.WriteString(arg.Value))
143 }
144 }
145 x.Check2(b.WriteString(")"))
146}
147
148// writeRoot writes the root function as well as any ordering and paging
149// specified in q.

Callers 2

writeRootFunction · 0.85
writeFilterFunctionFunction · 0.85

Calls 1

Check2Function · 0.92

Tested by

no test coverage detected