fair-rose•3y ago
custom queries
how to send raw graphql queries with meta data of useTAble am using hasura data provider
7 Replies
fair-roseOP•3y 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
sensitive-blue•3y 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 wayfair-roseOP•3y ago
hasura data provider
sensitive-blue•3y ago
fair-roseOP•3y ago
i need custom gql not this way
this one is the basic one which is in refine
sensitive-blue•3y 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.fair-roseOP•3y ago
ok