type-graphql#ID TypeScript Examples

The following examples show how to use type-graphql#ID. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NodeService.ts    From graphql-ts-client with MIT License 6 votes vote down vote up
@Query(() => Node, { nullable: true })
    async node(
        @Arg("id", () => ID) id: String
    ): Promise<Node | undefined> {
        await delay(1000);
        const departmentRow = departmentTable.findById(id);
        if (departmentRow !== undefined) {
            return new Department(departmentRow);
        }
        const employeeRow = employeeTable.findById(id);
        if (employeeRow !== undefined) {
            return new Employee(employeeRow);
        }
        return undefined;
    }
Example #2
Source File: EmployeeService.ts    From graphql-ts-client with MIT License 6 votes vote down vote up
@Mutation(() => ID)
    async deleteEmployee(
        @Arg("id", () => ID, {nullable: true}) id: string
    ): Promise<string | undefined> {

        /*
         * Mock the network delay
         */
        await delay(1000);

        return employeeTable.delete(id) !== 0 ? id : undefined;
    }
Example #3
Source File: DepartmentService.ts    From graphql-ts-client with MIT License 6 votes vote down vote up
@Mutation(() => ID)
    async deleteDepartment(
        @Arg("id", () => ID, {nullable: true}) id: string
    ): Promise<string | undefined> {
        
        /*
         * Mock the network delay
         */
        await delay(1000);

        return departmentTable.delete(id) !== 0 ? id : undefined;
    }
Example #4
Source File: message-types.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID)
  cursor: string;
Example #5
Source File: PersonalComputer.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => ID)
  @PrimaryGeneratedColumn()
  id: number;
Example #6
Source File: Employee.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => ID)
  @PrimaryGeneratedColumn("uuid")
  eid: string;
Example #7
Source File: Desk.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => ID)
  @PrimaryGeneratedColumn()
  id: number;
Example #8
Source File: Company.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => ID)
  @PrimaryGeneratedColumn("uuid")
  id: string;
Example #9
Source File: Chair.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => ID)
  @PrimaryGeneratedColumn()
  id: number;
Example #10
Source File: Cert.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => ID)
  @PrimaryGeneratedColumn()
  cid: number;
Example #11
Source File: MainEntity.ts    From liferay-grow with MIT License 5 votes vote down vote up
@Field(() => ID)
  @PrimaryColumn({ generated: 'uuid' })
  id: string;
Example #12
Source File: request.ts    From opensaas with MIT License 5 votes vote down vote up
@Field(() => ID)
  @Column('varchar', { length: 256, nullable: false })
  tenantId!: string;
Example #13
Source File: request.ts    From opensaas with MIT License 5 votes vote down vote up
@Field(() => ID)
  @PrimaryGeneratedColumn()
  id!: number;
Example #14
Source File: base.entity.ts    From mikro-orm-graphql-example with MIT License 5 votes vote down vote up
@Field(() => ID)
  @PrimaryKey({ type: 'uuid' })
  public id: string = v4();
Example #15
Source File: Node.ts    From graphql-ts-client with MIT License 5 votes vote down vote up
@Field(() => ID)
    readonly id: string
Example #16
Source File: user.ts    From typegraphql-nestjs with MIT License 5 votes vote down vote up
@Field(type => ID)
  id!: string;
Example #17
Source File: invitation-types.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID)
  id: ObjectID;
Example #18
Source File: Notification.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID)
  @prop({ ref: "user", required: true })
  public receiver!: Ref<User>;
Example #19
Source File: Notification.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID, { name: "id" })
  _id!: ObjectID;
Example #20
Source File: Message.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => [ID])
  @arrayProp({ ref: "user" })
  public mentions!: Ref<User>[];
Example #21
Source File: Message.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID)
  @prop({ ref: "room", required: true })
  public roomId!: Ref<Room>;
Example #22
Source File: Message.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID, { name: "id" })
  readonly _id: ObjectID;
Example #23
Source File: Member.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => [ID])
  public rooms!: Ref<Room>[];
Example #24
Source File: Member.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID, { name: "id" })
  _id: ObjectID;
Example #25
Source File: Invitation.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID)
  @prop({ ref: "room", required: true })
  public roomId!: Ref<Room>;
Example #26
Source File: Invitation.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID)
  @prop({ ref: "user" })
  public userId!: Ref<User>;
Example #27
Source File: Invitation.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID)
  @prop({ ref: "user", required: true })
  public invitedBy!: Ref<User>;
Example #28
Source File: Invitation.ts    From convoychat with GNU General Public License v3.0 5 votes vote down vote up
@Field(type => ID, { name: "id" })
  _id!: ObjectID;
Example #29
Source File: user.ts    From typegraphql-nestjs with MIT License 5 votes vote down vote up
@Directive("@external")
  @Field(type => ID)
  id!: string;