#Convert InputType fields type
9 messages · Page 1 of 1 (latest)
Looking at the docs I suppose I could write a middleware that converts numbers to strings, but is there a more built-in method?
Although trying that out doesn't seem to work, I guess the middleware is run after type validation?
@Type(() => String) should do it. Though you'll probably have to tell GQL that it's a number like @Field({ type: Number })
hmm @Field({ type: Number }) doesn't seem to be an accepted value
this is all it should take? ```ts
@Field(() => Float)
@Type(() => String)
someFloat: string
I believe so. With transform: true set in the ValidationPipe