@cran/gql.jm
Version:
Cran/GraphQL Join Monster Utilities
21 lines (20 loc) • 675 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withSqlBatch = void 0;
const gql_core_1 = require("@cran/gql.core");
function withSqlBatch(name = "sqlBatch") {
return (0, gql_core_1.createDirective)(name, {
this: "text!",
parent: "text!",
}, {
[gql_core_1.MapperKind.COMPOSITE_FIELD]([directive,], field) {
Object.assign((0, gql_core_1.getExtension)(field, "joinMonster", {}), {
sqlBatch: {
thisKey: directive.this,
parentKey: directive.parent,
},
});
},
});
}
exports.withSqlBatch = withSqlBatch;