R
Refine

ask-any-question

Pass a field from a foreign table which is in an array relationship to the filter in useList hook ?

Ssensitive-blue1/18/2023
const query = useList<IOrganization>({ resource: "organizations", metaData: { fields: ["id", { organization_units: ["id", "active"] }], }, config: { filters: [ { field: "organization_units.active", operator: "eq", value: true, }, ], }, }); here organization_units table is in foreign relationship with organization table. I need to access the active field of the organization_units table. This is not able to fetch the "organization_units.active" I need to fetch only those records which has active true in the organization_units table
Aautomatic-azure1/18/2023
Hey @coops8 Which data provider you're using?
Ssensitive-blue1/18/2023
Hasura @aliemirs ??
Aautomatic-azure1/18/2023
Hey @coops8 checking the issue now 🙏
OOmer1/18/2023
Hey @rehan1 , Any idea about this question?
Rrare-sapphire1/18/2023
even am not able to resolve this issue and i didnt get any reply
OOmer1/18/2023
cool, let's try to solve it now. 1. Can you share the Raw GraphQL query running in Hasura? 2. Could you share the metaData object you sent and the GraphQL query that appears in your Network tab? So we can solve the problem by looking at the difference between the two.
Ssensitive-blue1/18/2023
1. query MyQuery { organizations(where: {organization_units: {active: {_eq: true}}, id: {_eq: "b2752fe2-600d-4152-9c5c-355f335e5493"}}) { active about_us organization_units { active center_name     }   } } 2. {,…} query: "query ($limit: Int, $offset: Int, $where: organizations_bool_exp) { organizations (limit: $limit, offset: $offset, where: $where) { id, organization_units { id, active }, users { id, active } } organizations_aggregate (where: $where) { aggregate { count } } }" variables: {limit: 10, offset: 0,…} limit: 10 offset: 0 where: {_and: [{organization_units: {active: {_eq: true}}}]} _and: [{organization_units: {active: {_eq: true}}}] 0: {organization_units: {active: {_eq: true}}} organization_units: {active: {_eq: true}} active:{_eq: true} _eq: true 2nd one is the payload from the network tab
OOmer1/18/2023
Could you share a screenshot of your network tab?
Ssensitive-blue1/18/2023
No description
OOmer1/18/2023
Different filters are applied according to the raw graphql query. For example users Could you please share the same query? Don't forget to share the metaData as well
Rrare-sapphire1/18/2023
filtering is working in nhost dataprovider but not in hasura dataprovider "@pankod/refine-core": "^3.90.0", "@pankod/refine-hasura": "^4.15.0",
OOmer1/18/2023
I understand. @rehan1 , you must provide us with all the information so that we can resolve this issue. If something is not working, there can be dozens or even hundreds of reasons. If you like Refine and it makes your job easier, please help us to make this support sustainable and ask your questions as descriptive as possible. Unfortunately, "x is not working" does not contain enough information for us. Thank you very much for your understanding and attention 🎯
Rrare-sapphire1/18/2023
okay no issues

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
custom querieshow to send raw graphql queries with meta data of useTAble am using hasura data providerHowto set saveButtonProps.onClick correctly?I am trying to overwrite the `saveButtonProps.onClick` function. However i cant quite get it: ```jsHello allHello all Is there any live project that has been built using refine ? I want to see how does it loHow to submit different data when using useForm with Typescript?I have an Edit/Create page for my resource and I use Typescript. I wrote code according to docs, butHow to use `setFilters` from useTable for custom filter buttons?I I am trying to create a button that can increment or decrement a date value as shown on the screenHow to disable the upload when clicking on the preview button of the Dragger?<Dragger {...props} maxCount={1} style={{ background: "white" }} accDo resource interfaces have to be interfaces?Hi! I've followed the documentation while creating a Refine app and when I sent it for review one ofChange content-type depending on we need to edit or to create a ressourceI implemented the edit and the create possibility in my refine application. My API need the `applicaMulti level menu without nested URLI am using the following document to create nested items in the sidebar, but the URL of the nested ipermanent filter not getting applied idf its nestedthis is useTAble const { tableProps, setFilters } = useTable({ resource: "packages", metaDaI have a form field which is a nested Object how can I use `useDrawerForm` to create entry?I have a form field which would have dynamic fields based on an Object Array something like this [{'export 'App' (reexported as 'App') was not found in 'antd'After I have updated my refine-antd package from ``` "@pankod/refine-antd": "^4.1.0", "@pankod/refuseDrawerForm with additional parametersHi there, I am trying to use `useDrawerForm` . I have cards for different product type/categories. Atype 'FormPropsType'Getting this error message when following the guide - ERROR in src/App.tsx:81:17 TS2322: Type '{ iniuseTable Typing error is unkownGetting full typing expect for `error` : ```js import { useTable } from "@pankod/refine-react-table"BackdndHello there! I´m back on working on my project with Refine. The thing is that I chose strapiv4 as baPersistQueryClientHi! I would like to try using https://tanstack.com/query/v4/docs/react/plugins/persistQueryClient wiqueryOptions.enabledI am using Hasura/GraphQL with Ant Design and my hooks appear to still run queries even if `queryOptHey there I m having a hard time workingHey there! I'm having a hard time working around useTable() or useList(), such that the api I'm usinHello I have an api endpoint with parentHello, I have an api endpoint with parent paths, like api/v1/admin/organisations....when using refin