import { GraphQLFieldConfig , GraphQLFieldConfigArgumentMap , GraphQLObjectType , GraphQLOutputType , GraphQLScalarType } from 'graphql' ; export class Maga { } export function schema ( type ) { return new GraphQLObjectType ( { name : type . name , fields : type . prototype . _fields } ) ; } export function field < TSource , TContext , TArgs > ( f ) { return function ( target , propertyKey , descriptor ) { if ( ! target . _fields ) { target . _fields = { } ; } if ( ! ( f . type instanceof GraphQLObjectType || f . type instanceof GraphQLScalarType ) ) { f . type = schema ( f . type ) ; } target . _fields [ propertyKey ] = f ; } ; } export function or ( ... types ) { return types ; } export function ret ( type ) { } export function toSchema ( name , fields ) { }