Skip to content
Discussion options

You must be logged in to vote

You should be able to use getters and setters for aliasing properties, so that it's id outside and _id inside.

@InputType()
export class UserCreateInput {
  balance!: number;

  @Field(_type => Float, {
    nullable: false
  })
  get accountBalance() {
    return this.balance;
  }

  set accountBalance(balance: number) {
    this.balance = balance;
  }
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@arashi-dev
Comment options

Answer selected by arashi-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants