import type { PluginObj, types } from '@babel/core'; /** * Babel plugin that injects the auto-generated gqlorm backend into * `api/src/functions/graphql.ts` at build time. * * When `experimental.gqlorm.enabled = true` and `.cedar/gqlorm/backend.ts` * exists, this plugin: * * 1. Adds imports at the top of graphql.ts: * import * as __gqlorm_sdl__ from '../../../.cedar/gqlorm/backend' * import { db as __gqlorm_db__ } from 'src/lib/db' * * 2. Inserts a statement immediately before the `createGraphQLHandler` call: * sdls = { * ...sdls, * __gqlorm__: { * schema: __gqlorm_sdl__.schema, * resolvers: __gqlorm_sdl__.createGqlormResolvers(__gqlorm_db__), * }, * } * * The `sdls` variable is already a `let` binding at this point because * `babel-plugin-redwood-import-dir` transforms the glob import * `import sdls from 'src/graphql/**\/*.sdl.{js,ts}'` into `let sdls = {}`. * * This plugin is a no-op when gqlorm is disabled or the backend file does * not exist. */ export default function ({ types: t }: { types: typeof types; }): PluginObj; //# sourceMappingURL=babel-plugin-cedar-gqlorm-inject.d.ts.map