documentation/versioned_docs/version-3.xx.xx/examples/data-provider/nhost.md
refine Nhost GraphQL Data Provider comes out-of-the-box. Thanks to refine, you can connect to your Nhost database and create special queries and use your data easily. This example shows in detail how you can use the data in your Nhost database with refine project.
By default, the data provider assume that your ID type is uuid, you can change this behavior by using the idType option. You can pass Int or uuid as the value of idType option or use function to determine the idType based on the resource name.
idTypeThis will allow you to determine the idType for all resources.
const myDataProvider = dataProvider(client, {
idType: "Int",
});
idTypeThis will allow you to determine the idType based on the resource name.
const idTypeMap: Record<string, "Int" | "uuid"> = {
users: "Int",
posts: "uuid",
};
const myDataProvider = dataProvider(client, {
idType: (resource) => idTypeMap[resource] ?? "uuid",
});
:::note Demo Credentials Username: [email protected] Password: demodemo :::
<CodeSandboxExample path="--branch v3 data-provider-nhost" />