link-stack/apps/metamigo-frontend/lib/dataprovider.ts

18 lines
490 B
TypeScript
Raw Normal View History

2023-02-13 12:41:30 +00:00
import pgDataProvider from "ra-postgraphile";
import schema from "./graphql-schema.json";
2023-03-14 17:40:24 +00:00
export const metamigoDataProvider = async (client: any) => {
2023-02-13 12:41:30 +00:00
const graphqlDataProvider = await pgDataProvider(
client,
// @ts-expect-error: Missing property
{},
{ introspection: { schema: schema.data.__schema } }
);
2023-03-14 17:40:24 +00:00
const dataProvider = async (type: any, resource: any, params: any) => {
2023-02-13 12:41:30 +00:00
return graphqlDataProvider(type, resource, params);
};
return dataProvider;
};