How to use the type-graphql.registerEnumType 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 goldcaddy77 / warthog / test / generated / classes.ts View on Github external
createdAt_DESC = "createdAt_DESC",

  updatedAt_ASC = "updatedAt_ASC",
  updatedAt_DESC = "updatedAt_DESC",

  deletedAt_ASC = "deletedAt_ASC",
  deletedAt_DESC = "deletedAt_DESC",

  name_ASC = "name_ASC",
  name_DESC = "name_DESC",

  kitchenSinkId_ASC = "kitchenSinkId_ASC",
  kitchenSinkId_DESC = "kitchenSinkId_DESC"
}

registerEnumType(DishOrderByEnum, {
  name: "DishOrderByInput"
});

@TypeGraphQLInputType()
export class DishWhereInput extends BaseWhereInput {
  @TypeGraphQLField({ nullable: true })
  name_eq?: string;

  @TypeGraphQLField({ nullable: true })
  name_contains?: string;

  @TypeGraphQLField({ nullable: true })
  name_startsWith?: string;

  @TypeGraphQLField({ nullable: true })
  name_endsWith?: string;
github goldcaddy77 / warthog / examples / 04-many-to-many-relationship / generated / classes.ts View on Github external
updatedAt_DESC = "updatedAt_DESC",

  deletedAt_ASC = "deletedAt_ASC",
  deletedAt_DESC = "deletedAt_DESC",

  userId_ASC = "userId_ASC",
  userId_DESC = "userId_DESC",

  roleId_ASC = "roleId_ASC",
  roleId_DESC = "roleId_DESC",

  otherMetadata_ASC = "otherMetadata_ASC",
  otherMetadata_DESC = "otherMetadata_DESC"
}

registerEnumType(UserRoleOrderByEnum, {
  name: "UserRoleOrderByInput"
});

@TypeGraphQLInputType()
export class UserRoleWhereInput {
  @TypeGraphQLField(() => String, { nullable: true })
  id_eq?: string;

  @TypeGraphQLField(() => [String], { nullable: true })
  id_in?: string[];

  @TypeGraphQLField({ nullable: true })
  createdAt_eq?: String;

  @TypeGraphQLField({ nullable: true })
  createdAt_lt?: String;
github goldcaddy77 / warthog / examples / 07-feature-flags / generated / classes.ts View on Github external
description_DESC = "description_DESC",

  projKey_ASC = "projKey_ASC",
  projKey_DESC = "projKey_DESC",

  projectId_ASC = "projectId_ASC",
  projectId_DESC = "projectId_DESC",

  envKey_ASC = "envKey_ASC",
  envKey_DESC = "envKey_DESC",

  environmentId_ASC = "environmentId_ASC",
  environmentId_DESC = "environmentId_DESC"
}

registerEnumType(SegmentOrderByEnum, {
  name: "SegmentOrderByInput"
});

@TypeGraphQLInputType()
export class SegmentWhereInput {
  @TypeGraphQLField(() => String, { nullable: true })
  id_eq?: string;

  @TypeGraphQLField(() => [String], { nullable: true })
  id_in?: string[];

  @TypeGraphQLField({ nullable: true })
  createdAt_eq?: String;

  @TypeGraphQLField({ nullable: true })
  createdAt_lt?: String;
github juicycleff / ultimate-backend / libs / contracts / src / enums / index.ts View on Github external
registerEnumType(RoleActions, {
  name: 'RoleAction',
  description: 'Role action enum types',
});

registerEnumType(PlanPriceInterval, {
  name: 'PlanPriceInterval',
  description: 'Pricing interval enum',
});

registerEnumType(SubscriptionStatus, {
  name: 'SubscriptionStatus',
  description: 'Subscription status enum',
});

registerEnumType(InvoiceStatus, {
  name: 'InvoiceStatus',
  description: 'Invoice status enum',
});
github niklaskorz / nkchat / server / src / models / Message.ts View on Github external
import { ObjectID } from 'mongodb';
import { Field, ObjectType, registerEnumType } from 'type-graphql';
import { Column, Entity, ObjectIdColumn } from 'typeorm';

export enum EmbedType {
  Youtube = 'YOUTUBE',
  Alugha = 'ALUGHA',
  Image = 'IMAGE',
}

registerEnumType(EmbedType, {
  name: 'EmbedType',
});

@ObjectType()
export class Embed {
  @Field(type => EmbedType)
  @Column()
  type: EmbedType;

  @Field()
  @Column()
  src: string;
}

@ObjectType()
@Entity()
github goldcaddy77 / warthog / examples / 1-simple-model / generated / classes.ts View on Github external
lastName_DESC = "lastName_DESC",

  email_ASC = "email_ASC",
  email_DESC = "email_DESC",

  age_ASC = "age_ASC",
  age_DESC = "age_DESC",

  isRequired_ASC = "isRequired_ASC",
  isRequired_DESC = "isRequired_DESC",

  rating_ASC = "rating_ASC",
  rating_DESC = "rating_DESC"
}

registerEnumType(UserOrderByEnum, {
  name: "UserOrderByInput"
});

@TypeGraphQLInputType()
export class UserWhereInput extends BaseWhereInput {
  @TypeGraphQLField({ nullable: true })
  firstName_eq?: string;

  @TypeGraphQLField({ nullable: true })
  firstName_contains?: string;

  @TypeGraphQLField({ nullable: true })
  firstName_startsWith?: string;

  @TypeGraphQLField({ nullable: true })
  firstName_endsWith?: string;
github chanlito / untitled / server / lib / enums.ts View on Github external
export function configureEnums() {
  registerEnumType(Gender, { name: 'Gender' });
  registerEnumType(Role, { name: 'Role' });
  registerEnumType(SecurityTokenType, { name: 'SecurityTokenType' });
  registerEnumType(ThemeVariant, { name: 'ThemeVariant' });
}
github goldcaddy77 / warthog / examples / 5-migrations / generated / classes.ts View on Github external
updatedAt_DESC = "updatedAt_DESC",

  deletedAt_ASC = "deletedAt_ASC",
  deletedAt_DESC = "deletedAt_DESC",

  firstName_ASC = "firstName_ASC",
  firstName_DESC = "firstName_DESC",

  lastName_ASC = "lastName_ASC",
  lastName_DESC = "lastName_DESC",

  email_ASC = "email_ASC",
  email_DESC = "email_DESC"
}

registerEnumType(UserOrderByEnum, {
  name: "UserOrderByInput"
});

@TypeGraphQLInputType()
export class UserWhereInput extends BaseWhereInput {
  @TypeGraphQLField({ nullable: true })
  firstName_eq?: string;

  @TypeGraphQLField({ nullable: true })
  firstName_contains?: string;

  @TypeGraphQLField({ nullable: true })
  firstName_startsWith?: string;

  @TypeGraphQLField({ nullable: true })
  firstName_endsWith?: string;
github MichalLytek / type-graphql / experiments / prisma / generated / type-graphql / enums / Role.ts View on Github external
import { Arg, Args, ArgsType, Ctx, Field, FieldResolver, Float, ID, InputType, Int, Mutation, ObjectType, Query, Resolver, Root, registerEnumType } from "type-graphql";

/** Role enum comment */
export enum Role {
  USER = "USER",
  ADMIN = "ADMIN"
}
registerEnumType(Role, {
  name: "Role",
  description: "Role enum comment",
});
github jorisvddonk / WelcomeToTheFuture / backend / universe / Hazard.ts View on Github external
import { registerEnumType } from "type-graphql";

export enum Hazard {
  NONE = "NONE",
  MINIMUM = "MINIMUM",
  LOW = "LOW",
  MODERATE = "MODERATE",
  HIGH = "HIGH",
  SEVERE = "SEVERE",
  EXTREME = "EXTREME",
  INSTANT_DEATH = "INSTANT_DEATH"
}

registerEnumType(Hazard, {
  name: "Hazard"
})