{"record":{"id":"3d350029d3e903da","repo":"dagger/dagger","slug":"invalid-enum-name-null","errorCode":null,"errorMessage":"invalid enum name null","messagePattern":"invalid enum name null","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dagql/types.go","lineNumber":1794,"sourceCode":"\nfunc (e *EnumValueName) ToLiteral() call.Literal {\n\treturn call.NewLiteralEnum(e.Name)\n}\n\nfunc (e *EnumValueName) Decoder() InputDecoder {\n\treturn e\n}\n\nfunc (e *EnumValueName) DecodeInput(val any) (Input, error) {\n\tswitch x := val.(type) {\n\tcase *EnumValueName:\n\t\treturn &EnumValueName{Enum: e.Enum, Name: x.Name}, nil\n\tcase string:\n\t\treturn &EnumValueName{Enum: e.Enum, Name: x}, nil\n\tcase bool:\n\t\treturn nil, fmt.Errorf(\"invalid enum name %t\", x)\n\tcase nil:\n\t\treturn nil, fmt.Errorf(\"invalid enum name null\")\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"cannot create enum name from %T\", x)\n\t}\n}\n\nfunc (e *EnumValueName) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(e.Name)\n}\n\nfunc MustInputSpec(val Type) InputObjectSpec {\n\tspec := InputObjectSpec{\n\t\tName: val.TypeName(),\n\t}\n\tif desc, ok := val.(Descriptive); ok {\n\t\tspec.Description = desc.TypeDescription()\n\t}\n\tinputs, err := InputSpecsForType(val, true)\n\tif err != nil {","sourceCodeStart":1776,"sourceCodeEnd":1812,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/dagql/types.go#L1776-L1812","documentation":"Same EnumValueName construction path as the bool case: when the decoded payload is JSON null (Go nil interface), the constructor rejects it with the fixed message \"invalid enum name null\". dagql enums require an explicit registered member name; null is not a member, so nulls reaching an enum input surface as this error.","triggerScenarios":"Decoding an enum-typed input whose JSON value is null (e.g. {\"enumArg\": null}), or passing an untyped nil to the enum-name constructor — typically an unset GraphQL variable typed as an enum.","commonSituations":"GraphQL variables where an optional enum argument is explicitly set to null instead of omitted; SDKs serializing unset fields as null; clients built against schemas where the argument recently became non-nullable.","solutions":["Omit the variable from the request entirely rather than sending null, or send a valid registered member name.","Use omit-on-empty serialization in client code so unset enums are never emitted as null.","If absence should be allowed, mark the argument optional in the schema and ensure the SDK skips nil values; otherwise update callers to pass a concrete member."],"exampleFix":"// before\nvars := map[string]any{\"platform\": nil}\n// after\ndelete(vars, \"platform\") // omit instead of sending null","handlingStrategy":"validation","validationCode":"func isNullPayload(raw []byte) bool {\n    var v any\n    if err := json.Unmarshal(raw, &v); err != nil {\n        return false\n    }\n    return v == nil\n}","typeGuard":null,"tryCatchPattern":"if err := dagql.DecodeInput(&target, input); err != nil {\n    if strings.Contains(err.Error(), \"invalid enum name null\") {\n        return handleMissingEnum() // treat as unset, not a hard failure\n    }\n    return err\n}","preventionTips":["Omit optional enum variables instead of sending explicit null.","Configure serializers to skip nil/undefined fields in GraphQL variables.","Make enum arguments optional in the schema when absence is a valid state.","Review callers after an argument becomes non-nullable; nulls will now fail decoding."],"tags":["dagql","enum","null","json-decoding"],"backgroundTag":"unexpected-null-value","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}