UNPKG

@omnigraph/grpc

Version:
92 lines (91 loc) 2.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transportDirective = exports.grpcRootJsonDirective = exports.EnumDirective = exports.grpcConnectivityStateDirective = exports.grpcMethodDirective = void 0; const graphql_1 = require("graphql"); const transport_common_1 = require("@graphql-mesh/transport-common"); 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.grpcRootJsonDirective = new graphql_1.GraphQLDirective({ name: 'grpcRootJson', locations: [graphql_1.DirectiveLocation.OBJECT], args: { subgraph: { type: graphql_1.GraphQLString, }, name: { type: graphql_1.GraphQLString, }, rootJson: { type: transport_common_1.ObjMapScalar, }, loadOptions: { type: transport_common_1.ObjMapScalar, }, }, isRepeatable: true, }); 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], });