{"record":{"id":"8f63ff5331c93dc2","repo":"refinedev/refine","slug":"packages-hasura-multiple-filters-present-group","errorCode":null,"errorMessage":"@packages/hasura: multiple filters present. Group multiple parameters using the _and or the _or operator. Tip: You can use the _or and _and operators along with the _not operator to create arbitrarily complex boolean expressions involving multiple filtering criteria.","messagePattern":"@packages/hasura: multiple filters present\\. Group multiple parameters using the _and or the _or operator\\. Tip: You can use the _or and _and operators along with the _not operator to create arbitrarily complex boolean expressions involving multiple filtering criteria\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/hasura/src/utils/generateFilters.ts","lineNumber":210,"sourceCode":"  const arbitraryOperators = gqlVariableFilters.filter((f) => {\n    const [k] = f;\n    return !isMultiConditionFilter(k);\n  });\n\n  if (\n    arbitraryOperators.length > 1 ||\n    (metaFilters._and && arbitraryOperators.length)\n  ) {\n    if (!mergedFilters._and) {\n      mergedFilters._and = [];\n    }\n  }\n\n  if (\n    arbitraryOperators.length > 1 ||\n    ((metaFilters._and || metaFilters._or) && arbitraryOperators.length)\n  ) {\n    console.warn(\n      \"@packages/hasura: multiple filters present. Group multiple parameters using the _and or the _or operator. Tip: You can use the _or and _and operators along with the _not operator to create arbitrarily complex boolean expressions involving multiple filtering criteria.\",\n    );\n  }\n\n  gqlVariableFilters.forEach((filter) => {\n    const [k, v] = filter;\n\n    if (!isMultiConditionFilter(k) && mergedFilters._and) {\n      // Group Multiple Parameters Together\n      mergedFilters._and = mergedFilters._and.concat({ [k]: v });\n    } else if (k === \"_and\" && mergedFilters._and) {\n      // Merge _and conditions from both groups of Hasura Filters\n      if (!Array.isArray(v)) {\n        throw new Error(\n          \"@packages/hasura: unexpected value for BoolExp _and. Expected an Array.\",\n        );\n      }\n      mergedFilters._and = mergedFilters._and.concat(v);","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/hasura/src/utils/generateFilters.ts#L192-L228","documentation":"Console warning from @refinedev/hasura's `generateFilters`/`mergeHasuraFilters` util. Hasura GraphQL queries cannot express multiple top-level filters; they must be combined with `_and`/`_or` operators. When the incoming filter set yields more than one arbitrary operator filter, or a combination of _and/_or with additional arbitrary filters, the merger warns that the resulting query may be incorrect or dropped.","triggerScenarios":"Calling a data hook (useTable/useList with filters) against the Hasura data provider with `permanentFilter`/`filters` containing multiple operator filters (e.g. two `eq` filters on different fields) that are not nested under `_and`/`_or`, or mixing `_and`/`_or` blocks with loose operator filters.","commonSituations":"Defining multiple permanentFilter entries at the top level; combining user-applied table filters with pre-set permanent filters; migrating from a provider that auto-ANDs filters.","solutions":["Wrap multiple conditions in an `_and` (or `_or`) operator inside your filters: `[{ field: 'x', operator: 'eq', value: 1 }, ...]` → pass `{ operator: 'and', value: [...] }`","Set `meta.filters` / permanentFilter as a single grouped logical filter instead of a flat array of operator filters","Review @refinedev/hasura docs for nested logical filter structure and adjust your resource definition"],"exampleFix":"// before\npermanentFilter: [\n  { field: 'storeId', operator: 'eq', value: 1 },\n  { field: 'status', operator: 'eq', value: 'active' },\n]\n// after\npermanentFilter: {\n  operator: 'and',\n  value: [\n    { field: 'storeId', operator: 'eq', value: 1 },\n    { field: 'status', operator: 'eq', value: 'active' },\n  ],\n}","handlingStrategy":"validation","validationCode":"const looseFilters = filters.filter((f) => !['and','or'].includes(f.operator));\nif (looseFilters.length > 1) {\n  console.warn('Hasura: wrap multiple filters in an _and/_or group');\n}","typeGuard":"const isGrouped = (filters: any[]) =>\n  filters.every((f) => f.operator === 'and' || f.operator === 'or' || filters.length === 1);","tryCatchPattern":null,"preventionTips":["Structure permanentFilter as a single logical group from day one","Write an integration test asserting generated GraphQL contains only one top-level where clause"],"tags":["hasura","graphql","filters","data-provider","refine"],"backgroundTag":"query-filter-combination-invalid","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}