{"record":{"id":"b9b83d26d765c460","repo":"refinedev/refine","slug":"operator-operator-is-not-supported-for-the-medu","errorCode":null,"errorMessage":"Operator ${operator} is not supported for the Medusa data provider","messagePattern":"Operator (.+?) is not supported for the Medusa data provider","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/medusa/src/utils/mapOperator.ts","lineNumber":8,"sourceCode":"import type { CrudOperators } from \"@refinedev/core\";\n\nexport const mapOperator = (operator: CrudOperators): string => {\n  switch (operator) {\n    case \"eq\":\n      return \"\";\n    default:\n      throw Error(\n        `Operator ${operator} is not supported for the Medusa data provider`,\n      );\n  }\n};\n","sourceCodeStart":1,"sourceCodeEnd":13,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/medusa/src/utils/mapOperator.ts#L1-L13","documentation":"The Medusa data provider can only translate the \"eq\" CrudOperators filter into a Medusa store query; any other operator (contains, in, gte, lt, or, etc.) throws. Medusa's storefront query API only supports equality-style filtering, so the provider rejects unsupported filter operators early.","triggerScenarios":"Using a Refine hook with filters, e.g. useTable({ filters: { permanentSetters... } }) or onSearch, where a filter uses an operator other than \"eq\", such as { field: \"title\", operator: \"contains\", value: \"x\" }.","commonSituations":"Copying list/table filters from a Strapi or Supabase example app; enabling search inputs that default to \"contains\"; combining filters with \"or\".","solutions":["Change the filter operator to \"eq\" (or remove the filter) so mapOperator can handle it","Restructure the UI so only equality filters are exposed against Medusa resources","Pre-filter client-side or call Medusa's search endpoint directly for text search"],"exampleFix":"// before\nconst { tableProps } = useTable({ filters: { initial: [{ field: \"title\", operator: \"contains\", value: \"shirt\" }] } });\n\n// after\nconst { tableProps } = useTable({ filters: { initial: [{ field: \"title\", operator: \"eq\", value: \"shirt\" }] } });","handlingStrategy":"validation","validationCode":"const MEDUSA_OK = new Set([\"eq\"]);\nconst safeFilters = filters.filter((f) => MEDUSA_OK.has(f.operator));","typeGuard":"const isMedusaSupportedFilter = (f: { operator: string }): boolean => f.operator === \"eq\";","tryCatchPattern":"try { await dataProvider.getList({ resource, filters, pagination: { current: 1, pageSize: 10 } }); } catch (e) { if (String(e).includes(\"not supported for the Medusa\")) { /* drop non-eq filters and retry */ } else throw e; }","preventionTips":["Only expose equality filters in UI bound to Medusa resources","Centralize filter construction per provider so unsupported operators never reach Medusa"],"tags":["refine","medusa","filter","operator","data-provider"],"backgroundTag":"unsupported-filter-operator","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}