-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Feature: Add (Nested) Validation to Create / Update / Delete Args #23
[WIP] Feature: Add (Nested) Validation to Create / Update / Delete Args #23
Conversation
hmmmmmmmmmmmmmmmm... wait.. strange.. die travis CI build says it passes.. however, if you look into the output message, there are 2 tests failing!? See here: https://travis-ci.org/doug-martin/nestjs-query/jobs/653485852#L394 |
import { TodoItemInputDTO } from '../dto/todo-item-input.dto'; | ||
|
||
@ArgsType() | ||
export class CreateOneTodoItemArgs extends CreateOneArgsType(TodoItemInputDTO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required for the example?
@Field(() => ID, { description: 'The id of the record to delete.' }) | ||
input!: string | number; | ||
id!: string | number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should update the docs to reflect this change.
Hmm not sure why travis is showing as passing, Ill have to take a look at that. I think you can change the deepEqual to a objectContaining from |
I think the failing test issue should be resolved now. If you can rebase and push back up we can test it out. |
@johannesschobel Im going to issue a new PR with your changes merged and fixed tests. One thing Im going to revert is the renaming input to |
Sorry I'd didnt explain why...I need the changes for a project I'm working on also. |
sure, no problem.. glad i could help (although you did most of it, haha) |
Dear @doug-martin ,
this PR addresses the issue discussed in #19 .
in particular, the commits presented below add respective
@ValidateNested()
and@Type()
decorators as discussed.Please note, that this PR contains a breaking change, as i changed one
@Field
frominput
toid
to better fit the overall API. This breaking change is, however, encapsulated in one single commit!Further - I was not able to properly run all tests via
npm run test
. There are 2 tests related tocreate one
andcreate many
in thecreate.resolver.spec
file that won't pass. If you can tell me, how to properly fix the tests (or adapt my implementation) i would be happy to re-work specific parts.All the best and thank you very much for your time and effort!