How to use the type-graphql.Directive function in type-graphql

To help you get started, weโ€™ve selected a few type-graphql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github juicycleff / ultimate-backend / apps / service-project / src / types / project.type.ts View on Github external
/* tslint:disable:max-classes-per-file */
import { Directive, Field, ObjectType } from 'type-graphql';
import { Node } from '@ultimatebackend/contracts';
import { Filterable } from '@graphqlcqrs/core';

@Directive(`@key(fields: "id")`)
@ObjectType()
export class Project extends Node {

  @Filterable()
  @Field()
  name: string;

  @Filterable()
  @Field({ nullable: true })
  description?: string;
}
github juicycleff / ultimate-backend / apps / service-tenant / src / types / tenant.type.ts View on Github external
/* tslint:disable:max-classes-per-file */
import { ObjectType, Directive, GraphQLISODateTime } from 'type-graphql';
import { Field } from 'type-graphql/dist/decorators/Field';
import {  Node } from '@ultimatebackend/contracts';
import { TenantMember } from './tenant-member.type';
import { Filterable } from '@graphqlcqrs/core';

@Directive(`@key(fields: "id")`)
@ObjectType()
export class Tenant extends Node {

  @Filterable()
  @Field({ nullable: true })
  name: string;

  @Filterable()
  @Field({ nullable: true })
  normalizedName: string;

  @Field(() => [TenantAccessToken!], { nullable: true })
  tokens?: TenantAccessToken[];

  @Filterable({ type: TenantMember })
  @Field(() => [TenantMember!], { nullable: true })
github juicycleff / ultimate-backend / apps / service-tenant / src / types / tenant-member.type.ts View on Github external
import { Directive, Field, ObjectType } from 'type-graphql';
import { Filterable } from '@graphqlcqrs/core';
import { AppRole, InvitationStatus, Node } from '@ultimatebackend/contracts';
import { Tenant } from './tenant.type';

@Directive(`@key(fields: "id")`)
@ObjectType()
export class TenantMember extends Node {

  @Filterable()
  @Field()
  email: string;

  @Filterable()
  @Field()
  status: InvitationStatus;

  @Filterable()
  @Field()
  role: AppRole;

  @Field(() => Tenant)