File tree Expand file tree Collapse file tree
packages/dataprovider/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ const getFilters = (
253253 ) ;
254254 const { originalKey, key, comparator } = processKey ( _key ) ;
255255 if ( context . options . filters ?. [ originalKey ] ) {
256- return context . options . filters [ originalKey ] ( value ) ?? { } ; // null values are transformed to empty objects
256+ return context . options . filters [ originalKey ] ( value , context ) ?? { } ; // null values are transformed to empty objects
257257 }
258258 if ( key === "NOT" || key === "OR" || key === "AND" ) {
259259 return {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010
1111import { DocumentNode } from "graphql" ;
1212import { Resource } from "./constants/interfaces" ;
13+ import { BuildVariablesContext } from "./buildVariables/types" ;
1314
1415export type WhiteListFragment = {
1516 type : "whitelist" ;
@@ -90,7 +91,10 @@ export type ConfigOptions = {
9091 } ;
9192 aliasPrefix ?: string ;
9293 filters ?: {
93- [ filterName : string ] : ( value : any ) => Filter | void ;
94+ [ filterName : string ] : (
95+ value : any ,
96+ context : BuildVariablesContext ,
97+ ) => Filter | void ;
9498 } ;
9599 customizeInputData ?: CustomizeInputData ;
96100 introspection ?: IntrospectionOptions ;
You can’t perform that action at this time.
0 commit comments