{"record":{"id":"ba359fd0d44f1697","repo":"dgraph-io/dgraph","slug":"unknown-value-kind-d-for-value-s","errorCode":null,"errorMessage":"unknown value kind: %d, for value: %s","messagePattern":"unknown value kind: (.+?), for value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphql/schema/wrappers.go","lineNumber":2992,"sourceCode":"\t\tvars[value.Raw] = true\n\t\treturn value.String(), nil\n\tcase ast.IntValue:\n\t\treturn strconv.ParseInt(value.Raw, 10, 64)\n\tcase ast.FloatValue:\n\t\treturn strconv.ParseFloat(value.Raw, 64)\n\tcase ast.BooleanValue:\n\t\treturn strconv.ParseBool(value.Raw)\n\tcase ast.StringValue:\n\t\treturn value.Raw, nil\n\tcase ast.BlockValue, ast.EnumValue:\n\t\tif strictJSON {\n\t\t\treturn nil, fmt.Errorf(\"found unexpected value: %s\", value.String())\n\t\t}\n\t\treturn value.Raw, nil\n\tcase ast.NullValue:\n\t\treturn nil, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown value kind: %d, for value: %s\", value.Kind, value.String())\n\t}\n}\n\n// Given a template for a body with variables defined, this function parses the body\n// and converts it into a JSON representation and returns that. It also returns a list of the\n// variable names that are required by this template.\n// for e.g.\n// { author: $id, post: { id: $postID }}\n// would return\n// { \"author\" : \"$id\", \"post\": { \"id\": \"$postID\" }} and { \"id\": true, \"postID\": true}\n// If the final result is not a valid JSON, then an error is returned.\n//\n// In strictJSON mode block strings and enums are invalid and throw an error.\n// strictJSON should be false when the body template is being used for custom graphql arg parsing,\n// otherwise it should be true.\nfunc parseBodyTemplate(body string, strictJSON bool) (interface{}, map[string]bool, error) {\n\tif strings.TrimSpace(body) == \"\" {\n\t\treturn nil, nil, nil","sourceCodeStart":2974,"sourceCodeEnd":3010,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/graphql/schema/wrappers.go#L2974-L3010","documentation":"This is the fallback case of the GraphQL AST value-to-Go converter: the value node's Kind was not any recognized kind (Boolean, String, Block, Enum, Null). It indicates an unexpected/unhandled AST value kind reached the conversion function.","triggerScenarios":"A value node with an unhandled ast.Kind (e.g. IntValue/FloatValue or Variable if not handled elsewhere) is passed to this conversion function, hitting the default branch.","commonSituations":"Library bugs or custom AST construction, passing numeric or variable nodes into a converter that only expects string-like/null values, or version mismatch where new AST kinds aren't handled.","solutions":["Inspect the reported value kind and route numeric/variable values to the appropriate converter","Upgrade/patch the library so the converter handles all value kinds","Pre-process the AST to inline variables before conversion"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"v, err := convertValue(node)\nif err != nil {\n  if strings.Contains(err.Error(), \"unknown value kind\") {\n    log.Printf(\"unhandled AST kind %v\", node.Kind)\n    return handleUnknownKind(node) // custom branch\n  }\n  return err\n}","preventionTips":["Keep the converter updated for all ast.Kind values","Inline/simplify variable and numeric nodes before conversion","Report unhandled kinds upstream as library bugs"],"tags":["graphql","ast","unhandled-case"],"backgroundTag":"unhandled-ast-value-kind","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}