Replies: 1 comment
-
I found the answer. I can transfer the query in the connector's boot method. Saloon is amazing! ❤️ protected function defaultQuery(): array
{
return [
'select' => $this->select,
'limit' => $this->limit,
'offset' => $this->offset,
];
} public function boot(PendingRequest $pendingRequest): void
{
$query = $pendingRequest->query()->all();
foreach ($query as $key => $value) {
$pendingRequest->query()->remove($key);
}
$pendingRequest->query()->add('params', json_encode($query));
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working with this API that expects all queries to be JSON encoded and wrapped in a
params
field:This means that I can't modify the queries on the fly using the provided methods. The following would result in
sort
added outsideparams
.Is there a way to make this work? The only way I can think is to override the
ArrayStore
methods in my request class and merge the added queries into theparams
field. Any hints?Beta Was this translation helpful? Give feedback.
All reactions