{"record":{"id":"e0c92f6599d5796d","repo":"hasura/graphql-engine","slug":"error-from-data-source","errorCode":null,"errorMessage":"error from data source: {}","messagePattern":"error from data source: (.+?)","errorType":"exception","errorClass":"FieldError","httpStatus":null,"severity":"error","filePath":"v3/crates/execute/src/error.rs","lineNumber":33,"sourceCode":"/// An intermediate type to represent a field error response to be returned\n/// to an API client (GraphQL or JSON:API)\npub struct FieldErrorResponse {\n    pub message: String,\n    pub details: Option<serde_json::Value>,\n    pub is_internal: bool,\n}\n\n/// Field errors are raised during execution from a root field\n/// Ref: <https://spec.graphql.org/October2021/#sec-Errors.Field-errors>\n#[allow(clippy::duplicated_attributes)] // suppress spurious warnings from Clippy\n#[derive(Error, Debug, Transitive)]\n#[transitive(from(json::Error, FieldInternalError))]\n#[transitive(from(NDCUnexpectedError, FieldInternalError))]\n#[transitive(from(gql::normalized_ast::Error, FieldInternalError))]\n#[transitive(from(gql::introspection::Error, FieldInternalError))]\n#[transitive(from(FilterPredicateError, FieldInternalError))]\npub enum FieldError {\n    #[error(\"error from data source: {}\", connector_error.error_response.message())]\n    NDCExpected {\n        connector_error: ndc_client::ConnectorError,\n    },\n\n    #[error(\"field '{field_name:} not found in _Service\")]\n    FieldNotFoundInService { field_name: String },\n\n    #[error(\"subscription are not supported over HTTP\")]\n    SubscriptionsNotSupported,\n\n    #[error(\n        \"Relationship '{name}' is either remote or not having 'relation_comparisons' NDC capability; not supported for filtering\"\n    )]\n    RelationshipPredicatesNotSupported { name: RelationshipName },\n\n    #[error(\"internal error: {0}\")]\n    InternalError(#[from] FieldInternalError),\n}","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/execute/src/error.rs#L15-L51","documentation":"FieldError::NDCExpected — a data-connector (NDC) request returned a structured, expected error; the displayed message is the connector's own error_response message. 'Expected' means the connector deliberately reported a query-level failure (as opposed to an unexpected/internal transport error), typically caused by the shape of the query sent to it.","triggerScenarios":"Executing a GraphQL query where an NDC connector returns an expected error response: querying a collection/table that doesn't exist in the underlying data source, filtering on a nonexistent field, or violating data-source constraints (types, nullability).","commonSituations":"Metadata out of sync with the actual database schema (table/column renamed or dropped), capability mismatch between connector and metadata, or client queries referencing fields the data source can't serve.","solutions":["Read the connector's message — it usually names the exact table/field/problem","Compare metadata (collections/fields) against the actual data source schema and fix drift","Regenerate/refresh connector metadata after schema changes","Retry the query with only fields you have confirmed exist"],"exampleFix":"# before\nquery { users(filter: {user_name: {_eq: \"a\"}}) { id } }\n\n# after (field is actually 'name' in the data source)\nquery { users(filter: {name: {_eq: \"a\"}}) { id } }","handlingStrategy":"fallback","validationCode":"null","typeGuard":"fn is_ndc_expected(e: &FieldError) -> bool { matches!(e, FieldError::NDCExpected { .. }) }","tryCatchPattern":"Match FieldError::NDCExpected and forward connector_error.error_response to the GraphQL response as a data-source error (don't retry; it's deterministic).","preventionTips":["Regenerate connector metadata after any DB schema change","Validate queried fields/collections against metadata before sending","Add contract tests comparing metadata with live data-source schema"],"tags":["ndc","connector","data-source","graphql","rust"],"backgroundTag":"data-source-query-error","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}