@omnigraph/grpc
Version:
72 lines (71 loc) • 2.04 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transportDirective = exports.EnumDirective = exports.grpcConnectivityStateDirective = exports.grpcMethodDirective = void 0;
const graphql_1 = require("graphql");
exports.grpcMethodDirective = new graphql_1.GraphQLDirective({
name: 'grpcMethod',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
rootJsonName: {
type: graphql_1.GraphQLString,
},
objPath: {
type: graphql_1.GraphQLString,
},
methodName: {
type: graphql_1.GraphQLString,
},
responseStream: {
type: graphql_1.GraphQLBoolean,
},
},
});
exports.grpcConnectivityStateDirective = new graphql_1.GraphQLDirective({
name: 'grpcConnectivityState',
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
rootJsonName: {
type: graphql_1.GraphQLString,
},
objPath: {
type: graphql_1.GraphQLString,
},
},
});
exports.EnumDirective = new graphql_1.GraphQLDirective({
name: 'enum',
locations: [graphql_1.DirectiveLocation.ENUM_VALUE],
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
value: {
type: graphql_1.GraphQLString,
},
},
});
exports.transportDirective = new graphql_1.GraphQLDirective({
name: 'transport',
args: {
subgraph: {
type: graphql_1.GraphQLString,
},
kind: {
type: graphql_1.GraphQLString,
},
location: {
type: graphql_1.GraphQLString,
},
options: {
type: new graphql_1.GraphQLScalarType({ name: 'TransportOptions' }),
},
},
isRepeatable: true,
locations: [graphql_1.DirectiveLocation.SCHEMA],
});