import { DocumentNode, parse } from 'graphql'; import genSchema from './schema'; import { createMutation } from './mutation'; import { createGet } from './query'; import { GetOptions, SetOptions } from '@saulx/selva'; export { genSchema }; export { createGet, createMutation }; export { parse as parseGraphql }; export type BasedOp = { get?: GetOptions; set?: SetOptions; delete?: { $id: string; db?: string; }; fnCall?: { name: string | { $var: string; }; payload: any; }; fnObserve?: { name: string | { $var: string; }; payload: any; }; }; export type BasedGraphQL = { db: string; opType: 'GET' | 'SET'; ops: Record; variables: Record; }; export type GQLExecCtx = { schemas: Record; db?: string; }; export declare function gql(schema: any): (literals: string | readonly string[], ...args: any[]) => any; export declare function gqlDb(db: string, schema: any): (literals: string | readonly string[], ...args: any[]) => any; export declare function gqlToSelvaQuery(ctx: GQLExecCtx, document: DocumentNode): any[]; export declare function createOperations(ctx: GQLExecCtx, document: DocumentNode): BasedGraphQL; export declare function handleGraphqlVariables(op: BasedGraphQL, cur: any, variables: Record): any;