From 27fe5a8665d00e0d71461dc8b9348a55aa00c269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Zaninotto?= Date: Tue, 5 Nov 2024 21:59:11 +0100 Subject: [PATCH] Add documentation for guessers --- packages/ra-supabase/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/ra-supabase/README.md b/packages/ra-supabase/README.md index 7ba1df5..978d0e3 100644 --- a/packages/ra-supabase/README.md +++ b/packages/ra-supabase/README.md @@ -231,6 +231,29 @@ const dataProvider = supabaseDataProvider(config); As users authenticate through supabase, you can leverage [Row Level Security](https://supabase.com/docs/guides/auth/row-level-security). Users identity will be propagated through the dataProvider if you provided the public API (anon) key. Keep in mind that passing the `service_role` key will bypass Row Level Security. This is not recommended. +## Guessers + +`ra-supabase` provides alternative guessers for all CRUD pages, leveraging the OpenAPI schema provided by Supabase. Use these guessers instead of react-admin's default guessers for a better first experience. + +```jsx +import { Admin, Resource } from 'react-admin'; +import { ListGuesser, ShowGuesser, EditGuesser, CreateGuesser } from 'ra-supabase'; + +export const MyAdmin = () => ( + + + + + +); +``` + ## Using Hash Router Supabase uses URL hash links for its redirections. This can cause conflicts if you use a HashRouter. For this reason, we recommend using the BrowserRouter.