{"record":{"id":"7213226390e7bffb","repo":"refinedev/refine","slug":"operator-and-is-not-supported","errorCode":null,"errorMessage":"Operator 'and' is not supported","messagePattern":"Operator 'and' is not supported","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/supabase/src/utils/generateFilter.ts","lineNumber":86,"sourceCode":"            }\n\n            if (item.operator === \"endswith\") {\n              value = `%${value}`;\n            }\n            if (item.operator === \"in\") {\n              value = `(${item.value.map((val: any) => `\"${val}\"`).join(\",\")})`;\n            }\n\n            return `${item.field}.${mapOperator(item.operator)}.${value}`;\n          }\n          return;\n        })\n        .join(\",\");\n      return query.or(orSyntax);\n    }\n\n    case \"and\":\n      throw Error(\"Operator 'and' is not supported\");\n    default:\n      return query.filter(\n        filter.field,\n        mapOperator(filter.operator),\n        filter.value,\n      );\n  }\n};\n","sourceCodeStart":68,"sourceCodeEnd":95,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/supabase/src/utils/generateFilter.ts#L68-L95","documentation":"The Supabase filter generator historically did not support the \"and\" combinator, so any filter whose operator is \"and\" (a logical filter joining sub-filters) throws. Supabase/PostgREST expresses AND implicitly by stacking filters, so explicit 'and' filters were unsupported in this code path.","triggerScenarios":"Passing a logical filter { operator: \"and\", value: [filterA, filterB] } into useTable/useList filters with the Supabase provider, e.g. via permanentFilter or combined search filters.","commonSituations":"Combining multiple filters with logical operators copied from Strapi examples; using refine versions before Supabase and/or/nested logical filter support landed; upgrading refine and having legacy filter structures hit new code paths.","solutions":["Upgrade @refinedev/supabase (and refine core) to a version supporting logical 'and'/'or' filters","Replace the 'and' wrapper with flat filters — multiple filters on Supabase are ANDed by default","For complex AND/OR groups, build the filter with supabaseClient .or()/.and() manually via custom query logic"],"exampleFix":"// before\nfilters: [{ operator: \"and\", value: [{ field: \"status\", operator: \"eq\", value: \"active\" }, { field: \"price\", operator: \"lt\", value: 100 }] }]\n\n// after\nfilters: [\n  { field: \"status\", operator: \"eq\", value: \"active\" },\n  { field: \"price\", operator: \"lt\", value: 100 },\n]","handlingStrategy":"validation","validationCode":"const hasAnd = (filters: any[]): boolean =>\n  filters.some((f) => f.operator === \"and\" || (Array.isArray(f.value) && f.value?.some?.((v: any) => v.operator === \"and\")));","typeGuard":"const isSupportedFilter = (f: { operator: string }): boolean => f.operator !== \"and\";","tryCatchPattern":"try { await dataProvider.getList({ resource, filters }); } catch (e) { if (String(e).includes(\"'and' is not supported\")) { /* flatten logical and-filters into plain filters and retry */ } else throw e; }","preventionTips":["Flatten 'and' wrappers before passing filters to Supabase","Upgrade @refinedev/supabase where logical filters are supported","Keep filter-building logic provider-aware in a shared utility"],"tags":["refine","supabase","filter","operator","logical-filter"],"backgroundTag":"unsupported-filter-operator","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}