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-03-15 12:17:43 +00:00
|
|
|
const graphqlDataProvider: any = await pgDataProvider(
|
2023-02-13 12:41:30 +00:00
|
|
|
client,
|
|
|
|
|
// @ts-expect-error: Missing property
|
|
|
|
|
{},
|
|
|
|
|
{ introspection: { schema: schema.data.__schema } }
|
|
|
|
|
);
|
|
|
|
|
|
2023-03-15 12:17:43 +00:00
|
|
|
const dataProvider = async (type: any, resource: any, params: any) => graphqlDataProvider(type, resource, params);
|
2023-02-13 12:41:30 +00:00
|
|
|
|
|
|
|
|
return dataProvider;
|
|
|
|
|
};
|