{"record":{"id":"8378913065695448","repo":"hasura/graphql-engine","slug":"error-while-parsing-the-endpoint-w","errorCode":null,"errorMessage":"error while parsing the endpoint :%w","messagePattern":"error while parsing the endpoint :%w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/cli.go","lineNumber":803,"sourceCode":"\t\t}\n\t\t// set name of metadata directory\n\t\tec.MetadataDir = filepath.Join(ec.ExecutionDirectory, ec.Config.MetadataDirectory)\n\n\t\t_, err := os.Stat(ec.MetadataDir)\n\t\tif err != nil && stderrors.Is(err, fs.ErrNotExist) && len(ec.MetadataFile) == 0 {\n\t\t\terr = os.MkdirAll(ec.MetadataDir, os.ModePerm)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.E(op, fmt.Errorf(\"cannot create metadata directory: %w\", err))\n\t\t\t}\n\t\t}\n\t}\n\n\tec.Logger.Debug(\"graphql engine endpoint: \", ec.Config.Endpoint)\n\tec.Logger.Debug(strings.Repeat(\"*\", len(ec.Config.AdminSecret)))\n\n\turi, err := url.Parse(ec.Config.Endpoint)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error while parsing the endpoint :%w\", err))\n\t}\n\n\t// check if server is using metadata v3\n\tif ec.Config.APIPaths.V1Query != \"\" {\n\t\turi.Path = path.Join(uri.Path, ec.Config.APIPaths.V1Query)\n\t} else {\n\t\turi.Path = path.Join(uri.Path, \"v1/query\")\n\t}\n\n\trequestUri := uri.String()\n\n\tmetadata, err := commonmetadata.New(httpClient, requestUri).ExportMetadata()\n\tif err != nil {\n\t\treturn errors.E(op, err)\n\t}\n\n\tvar v struct {\n\t\tVersion int `json:\"version\"`","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/cli.go#L785-L821","documentation":"A type referenced in the metadata (e.g. as a field type or argument type) by its qualified name has not been defined anywhere. The resolver must be able to look up every referenced custom type name.","triggerScenarios":"Using a type like `my_type` in a model field or command argument when no object type, scalar type, or enum with that qualified name is declared in the metadata.","commonSituations":"Forgetting to include the type definition file; renaming a type without updating references; referencing types defined in another subgraph not being resolved; circular or ordering issues in metadata files.","solutions":["Define the missing type with the exact qualified name","Fix the reference (namespace + name) to point at an existing type","Ensure the subgraph/type definition containing it is included in the build"],"exampleFix":"// before\nmodels:\n  users:\n    fields:\n      address: Address   // Address not defined\n// after\ntypes:\n  Address: { fields: { ... } }\nmodels:\n  users:\n    fields:\n      address: Address","handlingStrategy":"validation","validationCode":"let defined: HashSet<_> = all_declared_type_names(&metadata).collect();\nfor t in referenced_type_names(&metadata) {\n    assert!(defined.contains(&t), \"type {t} referenced but not defined\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate metadata via a tool that only emits references to declared types","Run a reachability/lint pass that every referenced type name resolves"],"tags":["metadata","types","validation"],"backgroundTag":"undefined-type-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}