Skip to content

Commit 72c181f

Browse files
authored
feat: check slicing Arguments passed when requireOneSlicingArgument (#1456)
For an operation, the engine validates if slicing arguments of the field satisfy the configured listSize:requireOneSlicingArgument option.
1 parent 0507f24 commit 72c181f

6 files changed

Lines changed: 718 additions & 26 deletions

File tree

execution/engine/execution_engine.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ func (e *ExecutionEngine) Execute(ctx context.Context, operation *graphql.Reques
215215
if report.HasErrors() {
216216
return report
217217
}
218+
if costCalculator != nil {
219+
costCalculator.ValidateSliceArguments(e.config.plannerConfig, execContext.resolveContext.Variables, &report)
220+
if report.HasErrors() {
221+
return report
222+
}
223+
}
218224
operation.ComputeEstimatedCost(costCalculator, e.config.plannerConfig, execContext.resolveContext.Variables)
219225

220226
if execContext.resolveContext.TracingOptions.Enable && !execContext.resolveContext.TracingOptions.ExcludePlannerStats {

0 commit comments

Comments
 (0)