custom queries

how to send raw graphql queries with meta data of useTAble am using hasura data provider
7 Replies
sensitive-blue
sensitive-blue2y ago
const query = gql.query({ operation: "appointments", fields: ["id", { patient: ["name", "first_name"] }], }); const { tableProps: customres } = useTable({ resource: "appointments", metaData: query, }); i created custom query and passed in useTAble this way but data is undefined import * as gql from "gql-query-builder"; imported this way
harsh-harlequin
harsh-harlequin2y ago
Hey @rehan1, If your query consist of operation and fields properties. you can use; metaData.operation and metaData.fields Not sure if the rest of the stuff appending by the data provider gets on your way
sensitive-blue
sensitive-blue2y ago
hasura data provider
harsh-harlequin
harsh-harlequin2y ago
const { tableProps: customres } = useTable({
resource: "appointments",
metaData: {
operation: "appointments",
fields: ["id", { patient: ["name", "first_name"] }],
},
});
const { tableProps: customres } = useTable({
resource: "appointments",
metaData: {
operation: "appointments",
fields: ["id", { patient: ["name", "first_name"] }],
},
});
sensitive-blue
sensitive-blue2y ago
i need custom gql not this way this one is the basic one which is in refine
harsh-harlequin
harsh-harlequin2y ago
Unfortunately, currently there's no support for custom queries like this. You can use useCustom with metaData properties like operation, fields and variables which are sent to gql.query function. If this does not cover your case, you can import request (or rawRequest) and gql from @pankod/refine-hasura to send your request manually but this will be separated from the useTable and its pagination logic.
sensitive-blue
sensitive-blue2y ago
ok
More Posts
Howto 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 [{'