@@ -3,17 +3,13 @@ import 'reflect-metadata';
33import * as graphql from 'graphql' ;
44
55import { GraphQLType } from 'graphql' ;
6- import { IoCContainer } from './ioc-container' ;
76import { OrderByTypeFactory } from './order-by.type-factory' ;
87import { PageInfo } from './page-info.type' ;
98import { PaginationResponse } from './pagination.type' ;
109
1110export * from './decorator/' ;
1211export * from './metadata/options' ;
1312
14- export const GQ_QUERY_KEY = 'gq_query' ;
15- export const GQ_MUTATION_KEY = 'gq_mutation' ;
16- export const GQ_SUBSCRIPTION_KEY = 'gq_subscription' ;
1713export const GQ_FIELDS_KEY = 'gq_fields' ;
1814export const GQ_DESCRIPTION_KEY = 'gq_description' ;
1915
@@ -403,82 +399,3 @@ export function Description(body: string) {
403399 } as Function ;
404400}
405401
406- export function Query ( option ?: DefaultOption ) {
407- return function ( target : any , propertyKey : any ) {
408- if ( Reflect . hasMetadata ( GQ_QUERY_KEY , target ) ) {
409- let metadata = Reflect . getMetadata ( GQ_QUERY_KEY , target ) ;
410- metadata . push ( propertyKey ) ;
411- Reflect . defineMetadata ( GQ_QUERY_KEY , metadata , target ) ;
412- } else {
413- Reflect . defineMetadata ( GQ_QUERY_KEY , [ propertyKey ] , target ) ;
414- }
415-
416- if ( option ) {
417- // description
418- if ( option . description ) {
419- setDescriptionMetadata ( option . description , target , propertyKey ) ;
420- }
421- }
422-
423- } as Function ;
424- }
425-
426- export function Mutation ( option ?: DefaultOption ) {
427- return function ( target : any , propertyKey : any ) {
428- if ( Reflect . hasMetadata ( GQ_MUTATION_KEY , target ) ) {
429- let metadata = Reflect . getMetadata ( GQ_MUTATION_KEY , target ) ;
430- metadata . push ( propertyKey ) ;
431- Reflect . defineMetadata ( GQ_MUTATION_KEY , metadata , target ) ;
432- } else {
433- Reflect . defineMetadata ( GQ_MUTATION_KEY , [ propertyKey ] , target ) ;
434- }
435-
436- if ( option ) {
437- // description
438- if ( option . description ) {
439- setDescriptionMetadata ( option . description , target , propertyKey ) ;
440- }
441- }
442-
443- } as Function ;
444- }
445-
446- export function Subscription ( option ?: DefaultOption ) {
447- return function ( target : any , propertyKey : any ) {
448- if ( Reflect . hasMetadata ( GQ_SUBSCRIPTION_KEY , target ) ) {
449- let metadata = Reflect . getMetadata ( GQ_SUBSCRIPTION_KEY , target ) ;
450- metadata . push ( propertyKey ) ;
451- Reflect . defineMetadata ( GQ_SUBSCRIPTION_KEY , metadata , target ) ;
452- } else {
453- Reflect . defineMetadata ( GQ_SUBSCRIPTION_KEY , [ propertyKey ] , target ) ;
454- }
455-
456- if ( option ) {
457- // description
458- if ( option . description ) {
459- setDescriptionMetadata ( option . description , target , propertyKey ) ;
460- }
461- }
462-
463- } as Function ;
464- }
465-
466- export function Schema ( option ?: SchemaOption ) {
467- return function ( target : Function ) {
468- Reflect . defineMetadata ( 'gq_schema' , { } , target ) ;
469-
470- if ( option ) {
471- // description
472- if ( option . description ) {
473- setDescriptionMetadata ( option . description , target ) ;
474- }
475- }
476- } as Function ;
477- }
478-
479- export function UseContainer ( container : any ) {
480- return function ( target : Function ) {
481- IoCContainer . INSTANCE = container ;
482- } ;
483- }
484-
0 commit comments