File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
App/config/validator/mapping Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -138,3 +138,11 @@ Mutation:
138138 validation :
139139 cascade :
140140 groups : ['group2']
141+
142+ onlyPassedFieldsValidation :
143+ type : Boolean
144+ resolve : ' @=m("mutation_mock", args)'
145+ args :
146+ person :
147+ validation : cascade
148+ type : Person!
Original file line number Diff line number Diff line change 1+ Person :
2+ type : input-object
3+ config :
4+ fields :
5+ firstName :
6+ type : String
7+ validation :
8+ - NotBlank : ~
9+ - NotNull : ~
10+ surname :
11+ type : String
12+ validation :
13+ - NotBlank : ~
14+ - NotNull : ~
Original file line number Diff line number Diff line change @@ -87,6 +87,22 @@ public function testLinkedConstraintsValidationPasses(): void
8787 $ this ->assertTrue ($ result ['data ' ]['linkedConstraintsValidation ' ]);
8888 }
8989
90+ public function testOnlyPassedFieldsValidated (): void
91+ {
92+ $ query = '
93+ mutation {
94+ onlyPassedFieldsValidation(
95+ person: { firstName: "Joe" }
96+ )
97+ }
98+ ' ;
99+
100+ $ result = $ this ->executeGraphQLRequest ($ query );
101+
102+ $ this ->assertTrue (empty ($ result ['errors ' ]));
103+ $ this ->assertTrue ($ result ['data ' ]['onlyPassedFieldsValidation ' ]);
104+ }
105+
90106 public function testLinkedConstraintsValidationFails (): void
91107 {
92108 $ query = '
You can’t perform that action at this time.
0 commit comments