R
Refine

ask-any-question

useExport resource prop

Eextended-salmon7/28/2023
So currently I am in my "resource_1" list page and I am triggering export using useExport({resource:"resource_2"}) but my graphql query always goes to "resource_1". I am using refine with nhost hasura.
Kkapa.ai7/28/2023
Hi @shubham.srv. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The useExport hook in refine infers the resource to export from the current route of the browser by default. However, you can specify the resource to export by passing the resource prop to the useExport hook. Please note that in the migration from version 3.x.x to 4.x.x of refine, the resourceName prop was deprecated and replaced with the resource prop. So, if you're using version 4.x.x or later, make sure you're using the resource prop. Here's how you can use it:
const { triggerExport } = useExport({ resource: "resource_2" });
const { triggerExport } = useExport({ resource: "resource_2" });
This should send the GraphQL query to "resource_2" instead of "resource_1". If it's still not working as expected, there might be an issue with your setup or a bug in the library. For more detailed information, you can refer to the useExport documentation (https://refine.dev/docs/api-reference/core/hooks/import-export/useExport/). If you're still facing issues, I would recommend reaching out to the refine community or support for more specific help. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai7/28/2023
<@1003590847960449024> kapa.ai is still learning and improving, please let us know how it did by reacting below
Eextended-salmon7/28/2023
refine@core version is 4.5.8 And yes I am passing a resource name to resource prop. But its still taking the resource name from the route. @kapa.ai refine@core version is 4.5.8 And yes I am passing a resource name to resource prop. But its still taking the resource name from the route.
Kkapa.ai7/28/2023
Let me check the knowledge base for you. One moment! :books: ---------------------- I'm sorry to hear that you're still having trouble. Based on the information provided, it seems like there might be an issue with your setup or a potential bug in the library. The useExport hook should use the resource name provided in the resource prop, not the one from the route. If it's not behaving as expected, it might be worth checking your code for any potential errors or conflicts that might be causing this issue. If you've checked your code and the issue persists, I would recommend reaching out to the refine community or support for more specific help. They might be able to provide more insight into why this is happening and how to fix it. Unfortunately, the information provided in the extracts does not cover this specific issue, so I can't provide a more specific solution. I hope this general advice is helpful and I wish you the best of luck in resolving this issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai7/28/2023
<@1003590847960449024> kapa.ai is still learning and improving, please let us know how it did by reacting below
Sstormy-gold7/28/2023
Hey @shubham.srv I did a test with Codesandbox with two different resources, but I didn't see the problem you reported. Could it be a problem with the data provider? https://codesandbox.io/p/sandbox/cranky-visvesvaraya-yjjgh8

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
Supabase providerWhat I'm doing wrong? I trying to use supabase as a provider I connect the provider and I'm able tHow do I get rid of the annoying inferencer pop up?How do I get rid of the annoying inferencer pop up?How do I get rid of "Most of the page code is auto-generated by the Inferencer feature,"How do I get rid of "Most of the page code is auto-generated by the Inferencer feature,"How do I make the header light mode by default?How do I make the header light mode by default?Display the date in a TextField within an <Edit> component (MUI)How can I correctly display the date in a TextField within an <Edit> component? The API returns a vadataproviderHow can i extend rest dataprovider to add my custom functions?Hey folksHey folks, I created a new project using `npm create refine-app@latest` so I have following versionRefine antd EditIf the api is not present on the server and the edit button is clicked and the user is redirected toBuild not workingHey folks, I created a new project today using `npm create refine-app@latest` so I have following v[Bug?] Collapsed Layout Sider - Popup Stays Open on Page LoadI've set my sider to collapsed as default. However, for some reason, if you hard reload onto a page,Call useCustom on clickCall useCustom on clickuseCustom hook infoHow to fire useCustom hook programatically depending on some action?How to correctly display nested resource name in create hook notification ?I am getting a notification like "Successfully created orderes/1/items" when using the useCreateManyIssue while using edit and Use Form from antd , useone api is not getting automatically triggeredmy code for the edit part import React from 'react'; import { UserForm } from "pages/users/Form"; imHow do I implement Laravel Sanctum for authentication? Is it possible?How do I implement Laravel Sanctum for authentication? Is it possible?back button in list page beside titleI need a back button in list page beside titlepassword show/hideIam using Mui AuthPage for all auth routes. so in my updatePassword form, I want a password show/hidCalling Refetch() when Edit Call is Complete?Hi, I have a refetch() function and a useDrawerForm. Currently, I have refetch() called on submitPrepopulate form based on dropdown inside formHi! I have a form that includes a user select dropdown. Once the user is selected, another dropdowPassing Component PropsHow can I pass props to my modal created with useModal from my Mantine <Button> component?