append(implode("\n", Arr::flatten($arguments))) ->append(')') ->toString(); } return ''; } /** * Resolve the fields into arguments that are used for filtering. * * @param array $fields * @return array */ public function resolveFilterArguments(array $fields): array { return collect($fields) ->map(function (Field $field) { if ($field instanceof FilterableField) { return collect($field->filterDirectives()) ->map(fn (FilterDirective $directive) => $directive->toString()) ->toArray(); } }) ->flatten() ->toArray(); } }