import { DocumentNode } from "graphql" ; import { CREATE , DELETE , GET_LIST , GET_MANY , GET_MANY_REFERENCE , GET_ONE , UPDATE , } from "react-admin" ; export type WhiteListFragment = { type : "whitelist" ; fields : string [ ] ; } ; export type BlackListFragment = { type : "blacklist" ; fields : string [ ] ; } ; export const isDocumentNodeFragment = ( fragment ) : fragment is DocumentNode => { return "kind" in fragment && fragment . kind === "Document" ; } ; export const isOneAndManyFragment = ( fragment ) : fragment is DoubleFragment => { return "one" in fragment || "many" in fragment ; } ; export type ResourceFragment = DocumentNode | WhiteListFragment | BlackListFragment ; export type DoubleFragment = { one ? : ResourceFragment ; many ? : ResourceFragment ; } ; export type ResourceViewFragment = ResourceFragment | DoubleFragment ; export type ResourceView = { resource : string ; fragment : ResourceViewFragment ; } ; export type QueryDialect = "nexus-prisma" | "typegraphql" ; type Filter = Record < string , unknown > ; export type CustomizeInputDataFunction = ( data : Record < string , any > , rawParams : Record < string , any > ) => Record < string , unknown > ; export type CustomizeInputData = { [ name ] : { create ? : CustomizeInputDataFunction ; update ? : CustomizeInputDataFunction ; } ; } ; export type IntrospectionOptions = { schema ? : any ; } ; export type ConfigOptions = { resourceViews ? : { [ name ] : ResourceView ; } ; aliasPrefix ? : string ; filters ? : { [ filterName ] : ( value : any ) => Filter | void ; } ; customizeInputData ? : CustomizeInputData ; introspection ? : IntrospectionOptions ; } ; export type FetchType = typeof CREATE | typeof DELETE | typeof GET_LIST | typeof GET_MANY | typeof GET_MANY_REFERENCE | typeof GET_ONE | typeof UPDATE ; export type VariantOptions = { queryDialect ? : QueryDialect ; } ; export type OurOptions = ConfigOptions & VariantOptions ; type RaDataGraphqlOptions = { clientOptions ? : { uri : string ; } ; client ? : any ; } ; export type Options = RaDataGraphqlOptions & ConfigOptions & VariantOptions ; export type DataProviderOptions = RaDataGraphqlOptions & ConfigOptions & Partial < VariantOptions > ;