select() receives inconsistent arguments

Hi,

When using select() function (queryCollectionOptions) I found that it receives different argument types depending on the context:

- With queryFn: Receives the full wrapped response object
- With writeUpsert/writeInsert/writeUpdate: Receives the already-extracted array

A simple workaround looks like this, but I found this a bit confusing:

select: (response) => {
    if (Array.isArray(response)) {
      return response;  // Already extracted
    }
    return response.organizations;  // Wrapped response
  }


Is this the intended behaviour or am I missing something?
Was this page helpful?