{"record":{"id":"72582a919bed6637","repo":"dgraph-io/dgraph","slug":"you-must-specify-a-destination-value","errorCode":null,"errorMessage":"you must specify a 'destination' value","messagePattern":"you must specify a 'destination' value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphql/admin/backup.go","lineNumber":34,"sourceCode":"\t\"github.com/dgraph-io/dgraph/v25/graphql/schema\"\n\t\"github.com/dgraph-io/dgraph/v25/protos/pb\"\n\t\"github.com/dgraph-io/dgraph/v25/worker\"\n)\n\ntype backupInput struct {\n\tDestinationFields\n\tForceFull bool\n}\n\nfunc resolveBackup(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) {\n\tglog.Info(\"Got backup request\")\n\n\tinput, err := getBackupInput(m)\n\tif err != nil {\n\t\treturn resolve.EmptyResult(m, err), false\n\t}\n\tif input.Destination == \"\" {\n\t\terr := fmt.Errorf(\"you must specify a 'destination' value\")\n\t\treturn resolve.EmptyResult(m, err), false\n\t}\n\n\treq := &pb.BackupRequest{\n\t\tDestination:  input.Destination,\n\t\tAccessKey:    input.AccessKey,\n\t\tSecretKey:    input.SecretKey,\n\t\tSessionToken: input.SessionToken,\n\t\tAnonymous:    input.Anonymous,\n\t\tForceFull:    input.ForceFull,\n\t}\n\ttaskId, err := worker.Tasks.Enqueue(req)\n\tif err != nil {\n\t\treturn resolve.EmptyResult(m, err), false\n\t}\n\n\tmsg := fmt.Sprintf(\"Backup queued with ID %#x\", taskId)\n\tdata := response(\"Success\", msg)","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/graphql/admin/backup.go#L16-L52","documentation":"resolveBackup validates the backup mutation input and rejects the request when input.Destination is empty. A backup needs a destination URI (file path, S3/minio URL, etc.) telling Dgraph where to write the backup.","triggerScenarios":"Executing the backup mutation (via /admin GraphQL or /backup) where getBackupInput succeeded but input.destination was omitted or set to an empty string.","commonSituations":"Copy-pasting a backup mutation example without editing the destination; environment where the destination was supplied via a variable that resolved to \"\"; confusing the REST /backup endpoint's destination parameter with the GraphQL field name.","solutions":["Include a non-empty destination in the mutation, e.g. destination: \"/backups\" or \"s3://bucket/path\".","Verify any variable feeding destination resolves to a non-empty string before sending.","For S3 destinations also supply accessKey/secretKey as needed by your setup."],"exampleFix":"// before\nmutation { backup(input: {destination: \"\"}) { response { message } } }\n// after\nmutation { backup(input: {destination: \"/var/backups\"}) { response { message } } }","handlingStrategy":"validation","validationCode":"function requireDestination(dest) {\n  if (typeof dest !== 'string' || dest.trim() === '')\n    throw new Error(\"backup mutation requires a non-empty 'destination' (path or s3:// URI)\");\n}","typeGuard":"function hasDestination(v) { return typeof v?.destination === 'string' && v.destination.trim().length > 0; }","tryCatchPattern":"try { await backup(input); } catch (e) { if (String(e).includes(\"you must specify a 'destination' value\")) { throw new Error('Configure backup destination before invoking backup'); } throw e; }","preventionTips":["Store the backup destination in config and inject it into the mutation","Validate destination variables resolve to non-empty strings in CI","Test backup mutations against a staging cluster"],"tags":["graphql","admin","backup","input-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}