@@ -12,7 +12,7 @@ import {
1212} from "@apollo/server" ;
1313import { ServerOptions as WsServerOptions } from "graphql-ws" ;
1414
15- export interface GraphQLActionOptions {
15+ interface GraphQLActionOptions {
1616 query ?: string | string [ ] ;
1717 mutation ?: string | string [ ] ;
1818 subscription ?: string | string [ ] ;
@@ -27,37 +27,6 @@ export interface GraphQLActionOptions {
2727 dataLoaderBatchParam ?: string ;
2828}
2929
30- export interface ActionResolverSchema {
31- action : string ;
32- rootParams ?: {
33- [ key : string ] : string ;
34- } ;
35- dataLoader ?: boolean ;
36- nullIfError ?: boolean ;
37- skipNullKeys ?: boolean ;
38- params ?: { [ key : string ] : any } ;
39- }
40-
41- export interface ServiceResolverSchema {
42- [ key : string ] :
43- | {
44- [ key : string ] : ActionResolverSchema ;
45- }
46- | GraphQLScalarType ;
47- }
48-
49- export interface ServiceGraphQLSettings {
50- query ?: string | string [ ] ;
51- mutation ?: string | string [ ] ;
52- subscription ?: string | string [ ] ;
53- type ?: string | string [ ] ;
54- interface ?: string | string [ ] ;
55- union ?: string | string [ ] ;
56- enum ?: string | string [ ] ;
57- input ?: string | string [ ] ;
58- resolvers ?: ServiceResolverSchema ;
59- }
60-
6130declare module "moleculer-apollo-server" {
6231 export { GraphQLError } from "graphql" ;
6332
@@ -77,6 +46,37 @@ declare module "moleculer-apollo-server" {
7746 ) : ( req : IncomingRequest , res : GatewayResponse ) => Promise < void > ;
7847 }
7948
49+ export interface ActionResolverSchema {
50+ action : string ;
51+ rootParams ?: {
52+ [ key : string ] : string ;
53+ } ;
54+ dataLoader ?: boolean ;
55+ nullIfError ?: boolean ;
56+ skipNullKeys ?: boolean ;
57+ params ?: { [ key : string ] : any } ;
58+ }
59+
60+ export interface ServiceResolverSchema {
61+ [ key : string ] :
62+ | {
63+ [ key : string ] : ActionResolverSchema ;
64+ }
65+ | GraphQLScalarType ;
66+ }
67+
68+ export interface ServiceGraphQLSettings {
69+ query ?: string | string [ ] ;
70+ mutation ?: string | string [ ] ;
71+ subscription ?: string | string [ ] ;
72+ type ?: string | string [ ] ;
73+ interface ?: string | string [ ] ;
74+ union ?: string | string [ ] ;
75+ enum ?: string | string [ ] ;
76+ input ?: string | string [ ] ;
77+ resolvers ?: ServiceResolverSchema ;
78+ }
79+
8080 export interface ApolloMixinOptions {
8181 serverOptions ?: BaseApolloServerOptions < BaseContext > & {
8282 subscriptions ?: boolean | WsServerOptions ;
@@ -146,6 +146,10 @@ declare module "moleculer-apollo-server" {
146146 wsServer ?: WebSocketServer ;
147147 }
148148
149+ export interface ApolloServiceSettings {
150+ graphql ?: ServiceGraphQLSettings ;
151+ }
152+
149153 export function ApolloService ( options : ApolloMixinOptions ) : ServiceSchema ;
150154
151155 export function moleculerGql (
@@ -158,8 +162,4 @@ declare module "moleculer" {
158162 interface ActionSchema {
159163 graphql ?: GraphQLActionOptions ;
160164 }
161-
162- interface ServiceSettingSchema {
163- graphql ?: ServiceGraphQLSettings ;
164- }
165165}
0 commit comments