{"record":{"id":"1fd202e0f9bee53d","repo":"hasura/graphql-engine","slug":"unsupported-field-type-object-1fd202","errorCode":null,"errorMessage":"Unsupported field type \"object\"","messagePattern":"Unsupported field type \"object\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"dc-agents/sqlite/src/query.ts","lineNumber":142,"sourceCode":"  target: Target,\n  tableAlias: string,\n): string {\n  const result = Object.entries(fields)\n    .map(([fieldName, field]) => {\n      switch (field.type) {\n        case 'column':\n          return `${escapeString(fieldName)}, ${escapeIdentifier(field.column)}`;\n        case 'relationship':\n          const relationships = find_relationships(all_relationships, target);\n          const rel = relationships.relationships[field.relationship];\n          if (rel === undefined) {\n            throw new Error(\n              `Couldn't find relationship ${field.relationship} for field ${fieldName} on target ${JSON.stringify(target)}`,\n            );\n          }\n          return `'${fieldName}', ${relationship(all_relationships, rel, field, tableAlias)}`;\n        case 'object':\n          throw new Error('Unsupported field type \"object\"');\n        case 'array':\n          throw new Error('Unsupported field type \"array\"');\n        default:\n          return unreachable(field['type']);\n      }\n    })\n    .join(', ');\n\n  return tag('json_object', `JSON_OBJECT(${result})`);\n}\n\nexport function where_clause(\n  relationships: Relationships[],\n  expression: Expression,\n  queryTarget: Target,\n  queryTableAlias: string,\n): string {\n  const generateWhere = (","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/dc-agents/sqlite/src/query.ts#L124-L160","documentation":"The JSON_OBJECT field generator in the SQLite agent only supports `column` and `relationship` field types. A field with `type: 'object'` (a nested anonymous object selection, common in GraphQL-style APIs) is explicitly rejected because the agent cannot map it onto SQLite SQL generation.","triggerScenarios":"Sending a field selection containing `{ type: 'object', fields: {...} }` to the query endpoint — e.g. a client that supports nested object projections forwarding a shape the SQLite agent doesn't model.","commonSituations":"Sharing query-building code with connectors that support object fields; metadata modeling nested types; version changes that added object fields to the query language but not to this agent.","solutions":["Flatten object fields into explicit column/relationship fields","Model the nested structure as a relationship to another table or an interpolated target","Upgrade the agent if a newer version supports object fields"],"exampleFix":"// before\n{ fields: { address: { type: 'object', fields: { city: {type:'column', column:'city'} } } } }\n// after\n{ fields: { city: { type: 'column', column: 'city' } } }","handlingStrategy":"type-guard","validationCode":"for (const [k, f] of Object.entries(fields)) if (f.type === 'object') throw new Error(`Field ${k} uses unsupported type 'object'`);","typeGuard":"const isSupportedField = (f: Field): f is ColumnField | RelationshipField => f.type === 'column' || f.type === 'relationship';","tryCatchPattern":null,"preventionTips":["Flatten nested objects into columns/relationships before querying SQLite","Keep per-engine query builders; don't share rich field shapes across connectors"],"tags":["sqlite","query-builder","fields","unsupported-feature"],"backgroundTag":"unsupported-field-type","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}