type-graphql#Float TypeScript Examples
The following examples show how to use
type-graphql#Float.
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: Department.ts From graphql-ts-client with MIT License | 6 votes |
@Field(() => Float)
avgSalary(): number {
const arr = employeeTable
.findByProp("departmentId", this.id)
.map(row => row.salary);
return arr.length !== 0 ?
arr.reduce((p, c) => p + c, 0) / arr.length :
0;
}
Example #2
Source File: product.filter.ts From Cromwell with MIT License | 5 votes |
@Field(() => Float, { nullable: true })
minPrice?: number;
Example #3
Source File: product.filter.ts From Cromwell with MIT License | 5 votes |
@Field(() => Float, { nullable: true })
maxPrice?: number;
Example #4
Source File: product.filter.ts From Cromwell with MIT License | 5 votes |
@Field(type => Float, { nullable: true })
minPrice?: number;
Example #5
Source File: product.filter.ts From Cromwell with MIT License | 5 votes |
@Field(type => Float, { nullable: true })
maxPrice?: number;
Example #6
Source File: Employee.ts From graphql-ts-client with MIT License | 5 votes |
@Field(() => Float)
readonly salary: number;
Example #7
Source File: EmployeeInput.ts From graphql-ts-client with MIT License | 5 votes |
@Field(() => Float)
readonly salary: number;