{"record":{"id":"70bf06d8458da292","repo":"hasura/graphql-engine","slug":"cannot-read-config-w","errorCode":null,"errorMessage":"cannot read config: %w","messagePattern":"cannot read config: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/cli.go","lineNumber":672,"sourceCode":"\t// validate execution directory\n\terr := ec.validateDirectory()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"validating current directory failed: %w\", err))\n\t}\n\n\t// load .env file\n\terr = ec.loadEnvfile()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"loading .env file failed: %w\", err))\n\t}\n\n\t// set names of config file\n\tec.ConfigFile = filepath.Join(ec.ExecutionDirectory, \"config.yaml\")\n\n\t// read config and parse the values into Config\n\terr = ec.readConfig()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"cannot read config: %w\", err))\n\t}\n\n\t// initialize HTTP client\n\t// CLI uses a common http client defined in internal/httpc.Client\n\t// get TLS Config\n\ttlsConfig, err := httpc.GenerateTLSConfig(ec.Config.CAPath, ec.Config.InsecureSkipTLSVerify)\n\tif err != nil || tlsConfig == nil {\n\t\treturn errors.E(op, stderrors.New(\"error while getting TLS config\"))\n\t}\n\n\t// create a net/http.Client with TLS Config\n\tstandardHttpClient, err := httpc.NewHttpClientWithTLSConfig(tlsConfig)\n\tif err != nil || standardHttpClient == nil {\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"error while creating http client with TLS configuration %w\", err),\n\t\t)\n\t}","sourceCodeStart":654,"sourceCodeEnd":690,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/cli.go#L654-L690","documentation":"A filter predicate traverses a relationship whose source and target models live on different data connectors (different subgraphs). Cross-connector relationship filtering would require the engine to push a join across heterogeneous backends, which is not supported in filter expressions.","triggerScenarios":"Using a relationship in a 'where' filter where source model uses connector A (e.g. Postgres) and target model uses connector B (e.g. DynamoDB); filtering across two subgraphs composed in a federated/multi-source metadata setup.","commonSituations":"Adding a second data connector and reusing existing relationships in filters; federation-style setups with remote relationships expected to behave like local joins.","solutions":["Filter each subgraph's data separately and join at the client/graph level instead of inside the predicate","Restructure so both sides of the relationship live on the same data connector","Use a command or remote relationship that resolves cross-source data outside of filter predicates","Drop the cross-connector relationship from the filter expression"],"exampleFix":"# before\nwhere: { author: { name: { _eq: \"A\" } } } # author on different connector\n# after\nquery { authors(where: { name: { _eq: \"A\" } }) { articles(where: {...}) } }","handlingStrategy":"validation","validationCode":"// Reject cross-connector relationships in filter predicates up front\nconst src = model.connector[rel.source.model];\nconst tgt = model.connector[rel.target.model];\nif (src !== tgt) throw new Error('Cross-subgraph relationship cannot be used in filters');","typeGuard":"const isSameSubgraph = (meta, sourceModel, targetModel) => meta.models[sourceModel].data_connector === meta.models[targetModel].data_connector;","tryCatchPattern":"try { resolveFilter(); } catch (e) { if (e?.code === 'RelationshipAcrossSubgraphs') splitQueryClientSide(); else throw e; }","preventionTips":["Tag relationships with their connector in your metadata tooling","Design cross-source access via commands or remote relationships, not filters"],"tags":["relationship","cross-connector","subgraph","filtering","federation"],"backgroundTag":"cross-subgraph-relationship-filter","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}