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(
103103 ?ValidationCache $ cache = null
104104 ): array {
105105 if (isset ($ cache )) {
106- $ cached = $ cache ->isValidated ($ schema , $ ast , $ rules );
107- if ($ cached ) {
106+ if ($ cache ->isValidated ($ schema , $ ast , $ rules )) {
108107 return [];
109108 }
110109 }
111110
112- $ rules ??= static ::allRules ();
113- if ($ rules === []) {
111+ $ finalRules = $ rules ?? static ::allRules ();
112+ if ($ finalRules === []) {
114113 return [];
115114 }
116115
117116 $ typeInfo ??= new TypeInfo ($ schema );
118117 $ context = new QueryValidationContext ($ schema , $ ast , $ typeInfo );
119118
120119 $ visitors = [];
121- foreach ($ rules as $ rule ) {
120+ foreach ($ finalRules as $ rule ) {
122121 $ visitors [] = $ rule ->getVisitor ($ context );
123122 }
124123
@@ -133,7 +132,7 @@ public static function validate(
133132 $ errors = $ context ->getErrors ();
134133
135134 if (isset ($ cache ) && $ errors === []) {
136- $ cache ->markValidated ($ schema , $ ast );
135+ $ cache ->markValidated ($ schema , $ ast, $ rules );
137136 }
138137
139138 return $ errors ;
You can’t perform that action at this time.
0 commit comments