@omnigraph/mysql
Version:
102 lines (101 loc) • 3.04 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransportDirective = exports.MySQLTableForeignDirective = exports.MySQLDeleteDirective = exports.MySQLUpdateDirective = exports.MySQLInsertDirective = exports.MySQLSelectDirective = exports.MySQLCountDirective = void 0;
const graphql_1 = require("graphql");
exports.MySQLCountDirective = new graphql_1.GraphQLDirective({
name: 'mysqlCount',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
table: {
type: graphql_1.GraphQLString,
},
},
});
exports.MySQLSelectDirective = new graphql_1.GraphQLDirective({
name: 'mysqlSelect',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
table: {
type: graphql_1.GraphQLString,
},
columnMap: {
type: new graphql_1.GraphQLList(new graphql_1.GraphQLList(graphql_1.GraphQLString)),
},
},
});
exports.MySQLInsertDirective = new graphql_1.GraphQLDirective({
name: 'mysqlInsert',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
table: {
type: graphql_1.GraphQLString,
},
primaryKeys: {
type: new graphql_1.GraphQLList(graphql_1.GraphQLString),
},
},
});
exports.MySQLUpdateDirective = new graphql_1.GraphQLDirective({
name: 'mysqlUpdate',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
table: {
type: graphql_1.GraphQLString,
},
columnMap: {
type: new graphql_1.GraphQLList(new graphql_1.GraphQLList(graphql_1.GraphQLString)),
},
},
});
exports.MySQLDeleteDirective = new graphql_1.GraphQLDirective({
name: 'mysqlDelete',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
table: {
type: graphql_1.GraphQLString,
},
},
});
exports.MySQLTableForeignDirective = new graphql_1.GraphQLDirective({
name: 'mysqlTableForeign',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
columnName: {
type: graphql_1.GraphQLString,
},
},
});
exports.TransportDirective = new graphql_1.GraphQLDirective({
name: 'transport',
locations: [graphql_1.DirectiveLocation.SCHEMA],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
kind: {
type: graphql_1.GraphQLString,
},
location: {
type: graphql_1.GraphQLString,
},
},
isRepeatable: true,
});