@orion-js/graphql 4.0.0-next.2 → 4.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.cjs +477 -469
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -27
- package/dist/index.d.ts +58 -27
- package/dist/index.js +490 -470
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _orion_js_resolvers from '@orion-js/resolvers';
|
|
2
|
-
import { ResolverOptions, GlobalResolverResolve,
|
|
3
|
-
import { GlobalResolversMap, ModelResolversMap
|
|
2
|
+
import { ResolverOptions, GlobalResolverResolve, ModelResolverResolve, Resolver, ModelResolver as ModelResolver$1, ResolverMiddleware } from '@orion-js/resolvers';
|
|
3
|
+
import { GlobalResolversMap, ModelResolversMap } from '@orion-js/models';
|
|
4
4
|
import { express } from '@orion-js/http';
|
|
5
5
|
import { PubSubEngine } from 'graphql-subscriptions';
|
|
6
6
|
import { ApolloServerOptions } from '@apollo/server';
|
|
7
|
-
import { Schema } from '@orion-js/schema';
|
|
7
|
+
import { Schema, SchemaWithMetadata, SchemaNode } from '@orion-js/schema';
|
|
8
8
|
import * as graphql from 'graphql';
|
|
9
9
|
export { graphql as GraphQL };
|
|
10
10
|
|
|
@@ -66,54 +66,85 @@ declare function export_default$1(options: StartGraphQLOptions): Promise<void>;
|
|
|
66
66
|
declare function export_default(apolloOptions: ApolloServerOptions<any>, options: StartGraphQLOptions): void;
|
|
67
67
|
|
|
68
68
|
declare const _default$1: {
|
|
69
|
-
params: _orion_js_resolvers.Resolver<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
params: _orion_js_resolvers.Resolver<_orion_js_resolvers.GlobalResolverResolve<{
|
|
70
|
+
name: {
|
|
71
|
+
type: "ID";
|
|
72
|
+
};
|
|
73
|
+
mutation: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
};
|
|
76
|
+
}, {
|
|
77
|
+
name: {
|
|
78
|
+
type: "string";
|
|
79
|
+
};
|
|
80
|
+
params: {
|
|
81
|
+
type: "blackbox";
|
|
82
|
+
};
|
|
83
|
+
result: {
|
|
84
|
+
type: "string";
|
|
85
|
+
};
|
|
86
|
+
basicResultQuery: {
|
|
87
|
+
type: "string";
|
|
88
|
+
};
|
|
89
|
+
}, any, any>, undefined>;
|
|
73
90
|
};
|
|
74
91
|
|
|
75
|
-
declare const _default:
|
|
92
|
+
declare const _default: {
|
|
93
|
+
name: {
|
|
94
|
+
type: "string";
|
|
95
|
+
};
|
|
96
|
+
params: {
|
|
97
|
+
type: "blackbox";
|
|
98
|
+
};
|
|
99
|
+
result: {
|
|
100
|
+
type: "string";
|
|
101
|
+
};
|
|
102
|
+
basicResultQuery: {
|
|
103
|
+
type: "string";
|
|
104
|
+
};
|
|
105
|
+
};
|
|
76
106
|
|
|
77
|
-
declare function serializeSchema(params:
|
|
107
|
+
declare function serializeSchema(params: Schema): Promise<SchemaWithMetadata>;
|
|
78
108
|
|
|
79
|
-
declare function getBasicQuery(field:
|
|
109
|
+
declare function getBasicQuery(field: SchemaNode): Promise<string>;
|
|
80
110
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
declare function
|
|
86
|
-
declare function
|
|
111
|
+
type InternalGlobalResolverResolveAtDecorator<This, TParams, TReturns, TViewer, TInfo> = (this: This, ...args: Parameters<GlobalResolverResolve<TParams, TReturns, TViewer, TInfo>>) => ReturnType<GlobalResolverResolve<TParams, TReturns, TViewer, TInfo>>;
|
|
112
|
+
type InternalModelResolverResolveAtDecorator<This, TItem, TParams, TReturns, TViewer, TInfo> = (this: This, ...args: Parameters<ModelResolverResolve<TItem, TParams, TReturns, TViewer, TInfo>>) => ReturnType<ModelResolverResolve<TItem, TParams, TReturns, TViewer, TInfo>>;
|
|
113
|
+
type InternalDynamicResolverResolveAtDecorator<This, TParams = any, TReturns = any, TViewer = any, TItem = any, TInfo = any> = TItem extends undefined ? InternalGlobalResolverResolveAtDecorator<This, TParams, TReturns, TViewer, TInfo> : InternalModelResolverResolveAtDecorator<This, TItem, TParams, TReturns, TViewer, TInfo>;
|
|
114
|
+
|
|
115
|
+
declare function Resolvers(): (target: any, context: ClassDecoratorContext<any>) => void;
|
|
116
|
+
declare function Query<This>(options?: Omit<ResolverOptions<any>, 'resolve' | 'mutation'>): (method: InternalGlobalResolverResolveAtDecorator<This, any, any, any, any>, context: ClassMethodDecoratorContext<This, typeof method>) => InternalGlobalResolverResolveAtDecorator<This, any, any, any, any>;
|
|
117
|
+
declare function Mutation<This, TParams, TReturns, TViewer, TInfo>(options: Omit<ResolverOptions<any>, 'resolve' | 'mutation'>): (method: InternalGlobalResolverResolveAtDecorator<This, TParams, TReturns, TViewer, TInfo>, context: ClassMethodDecoratorContext<This, typeof method>) => InternalGlobalResolverResolveAtDecorator<This, TParams, TReturns, TViewer, TInfo>;
|
|
87
118
|
declare function getServiceResolvers(target: any): {
|
|
88
119
|
[key: string]: Resolver<GlobalResolverResolve>;
|
|
89
120
|
};
|
|
90
121
|
|
|
91
|
-
interface ModelResolverPropertyDescriptor extends Omit<PropertyDecorator, 'value'> {
|
|
92
|
-
value?: ModelResolverResolve;
|
|
93
|
-
}
|
|
94
|
-
declare function ModelResolver(options?: Omit<ResolverOptions<any>, 'resolve' | 'middlewares'>): (target: any, propertyKey: string, descriptor: ModelResolverPropertyDescriptor) => void;
|
|
95
122
|
interface ModelResolversOptions {
|
|
96
123
|
modelName?: string;
|
|
97
124
|
}
|
|
98
|
-
declare function ModelResolvers(typedSchema: any, options?: ModelResolversOptions):
|
|
125
|
+
declare function ModelResolvers(typedSchema: any, options?: ModelResolversOptions): (target: any, context: ClassDecoratorContext<any>) => void;
|
|
126
|
+
declare function ModelResolver<This, TItem, TParams, TReturns, TViewer, TInfo>(options?: Omit<ResolverOptions<any>, 'resolve' | 'middlewares'>): (method: InternalModelResolverResolveAtDecorator<This, TItem, TParams, TReturns, TViewer, TInfo>, context: ClassMethodDecoratorContext<This, typeof method>) => InternalModelResolverResolveAtDecorator<This, TItem, TParams, TReturns, TViewer, TInfo>;
|
|
99
127
|
declare function getServiceModelResolvers(target: any): {
|
|
100
128
|
[key: string]: {
|
|
101
129
|
[key: string]: ModelResolver$1<GlobalResolverResolve>;
|
|
102
130
|
};
|
|
103
131
|
};
|
|
104
132
|
|
|
105
|
-
declare function Subscriptions():
|
|
106
|
-
declare function Subscription<
|
|
133
|
+
declare function Subscriptions(): (target: any, context: ClassDecoratorContext<any>) => void;
|
|
134
|
+
declare function Subscription<TParams, TReturns>(options: Omit<OrionSubscriptionOptions, 'params' | 'returns'> & {
|
|
135
|
+
params: TParams;
|
|
136
|
+
returns: TReturns;
|
|
137
|
+
}): (_target: any, context: ClassFieldDecoratorContext) => void;
|
|
107
138
|
declare function getServiceSubscriptions(target: any): {
|
|
108
139
|
[key: string]: OrionSubscription;
|
|
109
140
|
};
|
|
110
141
|
|
|
111
142
|
declare function getTargetMetadata(target: any, propertyKey: string, metadataKey: string): any;
|
|
112
|
-
declare
|
|
113
|
-
declare
|
|
114
|
-
declare
|
|
143
|
+
declare function UseMiddleware<TMiddleware extends ResolverMiddleware, This>(params: TMiddleware): (method: InternalDynamicResolverResolveAtDecorator<This, any, any, any, any, any>, context: ClassMethodDecoratorContext<This, typeof method>) => InternalGlobalResolverResolveAtDecorator<This, any, any, any, any> | InternalModelResolverResolveAtDecorator<This, any, any, any, any, any>;
|
|
144
|
+
declare function ResolverParams<TParams, This>(params: TParams): (method: InternalDynamicResolverResolveAtDecorator<This, TParams>, context: ClassMethodDecoratorContext<This, typeof method>) => InternalGlobalResolverResolveAtDecorator<This, TParams, any, any, any> | InternalModelResolverResolveAtDecorator<This, any, TParams, any, any, any>;
|
|
145
|
+
declare function ResolverReturns<This>(returns: any): (method: InternalDynamicResolverResolveAtDecorator<This, any, any>, context: ClassMethodDecoratorContext<This, typeof method>) => InternalGlobalResolverResolveAtDecorator<This, any, any, any, any> | InternalModelResolverResolveAtDecorator<This, any, any, any, any, any>;
|
|
115
146
|
|
|
116
147
|
declare const getWebsockerViewer: (connectionParams: any) => Promise<any>;
|
|
117
148
|
declare const setGetWebsockerViewer: (getViewerFunc: (connectionParams: any) => any) => void;
|
|
118
149
|
|
|
119
|
-
export { type CreateOrionSubscriptionFunction, type ExecuteGraphQLCache,
|
|
150
|
+
export { type CreateOrionSubscriptionFunction, type ExecuteGraphQLCache, ModelResolver, ModelResolvers, type ModelResolversOptions, type ModelsResolversMap, Mutation, OrionSubscription, type OrionSubscriptionOptions, type OrionSubscriptionsMap, Query, ResolverParams, _default as ResolverParamsInfo, ResolverReturns, Resolvers, type StartGraphQLOptions, Subscription, Subscriptions, UseMiddleware, getBasicQuery as getBasicResultQuery, getServiceModelResolvers, getServiceResolvers, getServiceSubscriptions, getTargetMetadata, getWebsockerViewer, _default$1 as resolversSchemas, serializeSchema, setGetWebsockerViewer, export_default$1 as startGraphQL, export_default as startGraphiQL, createSubscription as subscription };
|