Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public API issues #244

Open
y-lohse opened this issue Oct 31, 2018 · 0 comments
Open

Public API issues #244

y-lohse opened this issue Oct 31, 2018 · 0 comments

Comments

@y-lohse
Copy link
Contributor

y-lohse commented Oct 31, 2018

@ptbrowne and I had a little chat regarding #241 — we agreed to leave #241 as it is, but found some problems in the current architecture that will have to be addressed at some point. Here's a recap, feel free to add to it / correct me. It's also not very structured.

Having bypass functions is a good thing, but we should avoid using APIs that are considered private. So when here we write query.client.collection(doctype).upload(), we know way too much about the internals of cozy-client.

Ultimately, most of the API is implemented in the collections (DocumentCollection, FileCollection, etc). These are not actually collections, they are just API wrappers. But they are also hard to use at the moment, since they aren't directly exposed.
Even if they were, they need a CozyStackClient instance to work, and it's not trivial to get one of these instances, for exemple from inside a query or a mutation. There is also confusion between CozyStackClient and CozyClient, so renaming one of them might be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant