{"record":{"id":"1e82e131762d0801","repo":"cayleygraph/cayley","slug":"unsupported-query-language-q","errorCode":null,"errorMessage":"unsupported query language: %q","messagePattern":"unsupported query language: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/repl/repl.go","lineNumber":96,"sourceCode":"\treturn nil\n}\n\nconst (\n\tdefaultLanguage = \"gizmo\"\n\n\tps1 = \"cayley> \"\n\tps2 = \"...     \"\n\n\thistory = \".cayley_history\"\n)\n\nfunc Repl(ctx context.Context, h *graph.Handle, queryLanguage string, timeout time.Duration) error {\n\tif queryLanguage == \"\" {\n\t\tqueryLanguage = defaultLanguage\n\t}\n\tl := query.GetLanguage(queryLanguage)\n\tif l == nil || l.Session == nil {\n\t\treturn fmt.Errorf(\"unsupported query language: %q\", queryLanguage)\n\t}\n\tses := l.Session(h.QuadStore)\n\n\tterm, err := terminal(history)\n\tif os.IsNotExist(err) {\n\t\tfmt.Printf(\"creating new history file: %q\\n\", history)\n\t}\n\tdefer persist(term, history)\n\n\tvar (\n\t\tprompt = ps1\n\n\t\tcode string\n\t)\n\n\tnewCtx := func() (context.Context, func()) { return ctx, func() {} }\n\tif timeout > 0 {\n\t\tnewCtx = func() (context.Context, func()) { return context.WithTimeout(ctx, timeout) }","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/cayleygraph/cayley/blob/81dcd7d73e45136bc0d01802a8ba4685d8a533eb/internal/repl/repl.go#L78-L114","documentation":"This error means the REPL could not find a usable query language implementation for the requested name. query.GetLanguage(queryLanguage) returned nil, or the language has no Session factory, so there is no way to start an interactive session. Cayley aborts the REPL rather than silently defaulting to a different language.","triggerScenarios":"Calling internal/repl.Repl (via the `cayley repl` command) with a queryLanguage string that is not registered — e.g. a misspelled name like 'gizmo'/'Gizmo' case mismatch, 'graphql' when the graphql package was never imported/registered in the build, or an empty string that still fails because no default language registered a Session.","commonSituations":"Typo in --query-language flag; using a slim build that omits the graphql or gizmo query language packages; case-sensitivity mistakes ('gizmo' vs 'Gizmo' — names are registered with exact casing); older versions where the language name changed.","solutions":["Check the language name spelling and casing against registered languages (e.g. \"gizmo\", \"graphql\").","Ensure the corresponding query language package is imported/linked into your build (binary distributions include all; custom builds may not).","Run without --query-language to use the default language and confirm what it resolves to.","Update Cayley if your version renamed the language you want."],"exampleFix":"// before\ncayley repl --query-language Gizmo\n// after\ncayley repl --query-language gizmo","handlingStrategy":"validation","validationCode":"l := query.GetLanguage(lang)\nif l == nil || l.Session == nil {\n\t// pick \"gizmo\" or register the language package before starting the REPL\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the --query-language value with query.GetLanguage before launching.","Ensure your build imports all query language packages you need.","Use exact registered casing for language names (e.g. \"gizmo\", \"graphql\").","Pin Cayley versions in scripts so language names don't change unexpectedly."],"tags":["go","repl","query-language","cli"],"backgroundTag":"invalid-argument-value","analyzedSha":"81dcd7d73e45136bc0d01802a8ba4685d8a533eb","analyzedAt":"2026-09-06T06:14:12.358Z","contentChangedAt":"2026-09-06T06:14:12.358Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}