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

Function parseInsertedIDLiteral

tests/update_test.go:14–24  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

12)
13
14func parseInsertedIDLiteral(data []byte) (string, error) {
15 var payload any
16 if err := json.Unmarshal(data, &payload); err != nil {
17 return "", err
18 }
19 idVal, ok := findJSONIDValue(payload)
20 if !ok {
21 return "", fmt.Errorf("missing id in mutation response: %s", string(data))
22 }
23 return idLiteralFromAny(idVal)
24}
25
26func idLiteralFromAny(idVal any) (string, error) {
27 switch v := idVal.(type) {

Callers 1

TestMultiAliasDeleteFunction · 0.85

Calls 2

findJSONIDValueFunction · 0.85
idLiteralFromAnyFunction · 0.85

Tested by

no test coverage detected