UNPKG

1.19 kBTypeScriptView Raw
1import 'reflect-metadata';
2import { Complexity } from '../interfaces';
3import { BaseTypeOptions } from '../interfaces/base-type-options.interface';
4import { ReturnTypeFunc } from '../interfaces/return-type-func.interface';
5/**
6 * Interface defining options that can be passed to `@Query()` decorator.
7 */
8export type QueryOptions<T = any> = BaseTypeOptions<T> & {
9 /**
10 * Name of the query.
11 */
12 name?: string;
13 /**
14 * Description of the query.
15 */
16 description?: string;
17 /**
18 * Query deprecation reason (if deprecated).
19 */
20 deprecationReason?: string;
21 /**
22 * Query complexity options.
23 */
24 complexity?: Complexity;
25};
26/**
27 * Query handler (method) Decorator. Routes specified query to this method.
28 */
29export declare function Query(): MethodDecorator;
30/**
31 * Query handler (method) Decorator. Routes specified query to this method.
32 */
33export declare function Query(name: string): MethodDecorator;
34/**
35 * Query handler (method) Decorator. Routes specified query to this method.
36 */
37export declare function Query(typeFunc: ReturnTypeFunc, options?: QueryOptions): MethodDecorator;
38//# sourceMappingURL=query.decorator.d.ts.map
\No newline at end of file