File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -103,22 +103,21 @@ public static function validate(
103
103
?ValidationCache $ cache = null
104
104
): array {
105
105
if (isset ($ cache )) {
106
- $ cached = $ cache ->isValidated ($ schema , $ ast , $ rules );
107
- if ($ cached ) {
106
+ if ($ cache ->isValidated ($ schema , $ ast , $ rules )) {
108
107
return [];
109
108
}
110
109
}
111
110
112
- $ rules ??= static ::allRules ();
113
- if ($ rules === []) {
111
+ $ finalRules = $ rules ?? static ::allRules ();
112
+ if ($ finalRules === []) {
114
113
return [];
115
114
}
116
115
117
116
$ typeInfo ??= new TypeInfo ($ schema );
118
117
$ context = new QueryValidationContext ($ schema , $ ast , $ typeInfo );
119
118
120
119
$ visitors = [];
121
- foreach ($ rules as $ rule ) {
120
+ foreach ($ finalRules as $ rule ) {
122
121
$ visitors [] = $ rule ->getVisitor ($ context );
123
122
}
124
123
@@ -133,7 +132,7 @@ public static function validate(
133
132
$ errors = $ context ->getErrors ();
134
133
135
134
if (isset ($ cache ) && $ errors === []) {
136
- $ cache ->markValidated ($ schema , $ ast );
135
+ $ cache ->markValidated ($ schema , $ ast, $ rules );
137
136
}
138
137
139
138
return $ errors ;
You can’t perform that action at this time.
0 commit comments