MCPcopy
hub / github.com/dosco/graphjin / writeGraphQLLiteral

Function writeGraphQLLiteral

core/database_join.go:268–286  ·  view source on GitHub ↗
(buf *bytes.Buffer, col sdata.DBColumn, val []byte)

Source from the content-addressed store, hash-verified

266}
267
268func writeGraphQLLiteral(buf *bytes.Buffer, col sdata.DBColumn, val []byte) {
269 s := strings.TrimSpace(string(val))
270 if s == "" {
271 buf.WriteString("null")
272 return
273 }
274
275 if isGraphQLStringColumnType(col.Type) {
276 writeGraphQLStringLiteral(buf, s)
277 return
278 }
279
280 if isJSONStringLiteral(s) || isBareGraphQLLiteral(s) {
281 buf.WriteString(s)
282 return
283 }
284
285 writeGraphQLStringLiteral(buf, s)
286}
287
288func writeGraphQLStringLiteral(buf *bytes.Buffer, s string) {
289 if isJSONStringLiteral(s) {

Callers 2

buildChildGraphQLQueryFunction · 0.85

Calls 5

isJSONStringLiteralFunction · 0.85
isBareGraphQLLiteralFunction · 0.85
WriteStringMethod · 0.65

Tested by 1