UNPKG

@cran/gql.jm

Version:

Cran/GraphQL Join Monster Utilities

17 lines (16 loc) 524 B
import { MapperKind, createDirective, getExtension } from "@cran/gql.core"; export function withSqlBatch(name = "sqlBatch") { return createDirective(name, { this: "text!", parent: "text!", }, { [MapperKind.COMPOSITE_FIELD]([directive,], field) { Object.assign(getExtension(field, "joinMonster", {}), { sqlBatch: { thisKey: directive.this, parentKey: directive.parent, }, }); }, }); }