cozy / cozy-client

Document store and React components for the Cozy platform
MIT License
13 stars 12 forks source link

cozy-client: query() should hydrateDocuments? #493

Open Crash-- opened 5 years ago

Crash-- commented 5 years ago

ATM, when we use client.query(), we have to manually hydrate the documents https://github.com/cozy/cozy-drive/pull/1778/files/304a853bbf577d24649cdeda192c3b93ca660abe#diff-8bcb276dfd46a83c6e2e13ff28b8ad23R87

But with an ObservableQuery, we hydrate the docs automatically.

Is there any reason to not hydrate the documents when a perform a query() ?

ptbrowne commented 5 years ago

I agree, I think hydrating in the query call is a good thing.

ptbrowne commented 4 years ago

Would you be interested in taking a look @Crash-- ? I think first having an option { hydrate: true } to query would be easy and useful.

paultranvan commented 11 months ago

Ping @Crash-- ;) we recently got a situation of missing relationships because of client.query made in node. Adding client.hydrateDocuments works, but it's easy to miss / forget