Get the inferred type of Variables from data provider
I want to access the typescript type of variables parameter from one of my data provider method update. However, refine does not seem automatically infer the type defined in useForm hook
variables parameter from a data provider method like update, you can use the GetVariables utility type provided by refine. This utility type helps extract the type of variables from your queries or mutations.GetVariables to infer the type of the variables parameter:variables parameter. You can then use this type in your useForm hook or any other place where you need to specify the type of variables.useForm hook, you can do something like this:variables parameter is correctly typed throughout your application.GetVariablesGetVariablesimport { useForm } from "@refinedev/core";
import { GetVariables } from "@refinedev/hasura";
import { PostCreateMutation } from "src/graphql/types";
import { POST_CREATE_MUTATION } from "./queries";
const { formProps } = useForm<
GetFields<PostCreateMutation>,
HttpError,
GetVariables<PostCreateVariables>
>({
meta: { gqlMutation: POST_CREATE_MUTATION },
});