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

Model based APIs for API Category check against existence of DataStore #239

Closed
lawmicha opened this issue Dec 6, 2019 · 5 comments
Closed
Labels
api Issues related to the API category datastore Issues related to the DataStore category feature-request Request a new feature

Comments

@lawmicha
Copy link
Contributor

lawmicha commented Dec 6, 2019

since removing the syncable flag in the models (they weren't being model generated at the moment anyways). and the change to datastore to always treat non-system models as syncable, then API category's Model based APIs are broken. API needs a way to check if DataStore exists, and if it does not, treat the models non-syncable. If datastore exists, developer should use datastore

@lawmicha lawmicha changed the title Model based APIs for API Category check against existence of Datastore Model based APIs for API Category check against existence of DataStore Dec 6, 2019
@lawmicha
Copy link
Contributor Author

lawmicha commented Dec 9, 2019

#238 (comment)

@palpatim
Copy link
Member

palpatim commented Dec 9, 2019

Related to #177

@palpatim palpatim added api Issues related to the API category enhancement datastore Issues related to the DataStore category labels Jan 13, 2020
@jamesonwilliams
Copy link

API needs a way to check if DataStore exists

Why does API need to know of the existence of DataStore? Shouldn't DataStore depend on API, but API know nothing of DataStore?

@lawmicha
Copy link
Contributor Author

lawmicha commented Mar 4, 2020

API needs a way to check if DataStore exists

Why does API need to know of the existence of DataStore? Shouldn't DataStore depend on API, but API know nothing of DataStore?

Right, originally the Model Based API in API plugin had a dependency on ModelRegistry, which then makes it look like API depends on if sync enabled is true which is DataStore's use case. this code has been refactored and no longer checks for sync-enabled. consumers now have to explicitly construct requests which have sync fields or not.

@lawmicha lawmicha closed this as completed Mar 4, 2020
@lawmicha lawmicha reopened this Mar 4, 2020
@drochetti drochetti removed the P0 label Jun 24, 2020
@lawmicha
Copy link
Contributor Author

i believe this can be closed- Using API's GraphQLRequest builders with APIPlugin directly should be done on an API that does not have conflict resolution enabled. The original issue was opened with the idea that the builders should fail to construct the request if the API does have conflict resolution enabled, but this would have just moved the failure earlier. Instead, we can keep this logic out of the builders and leave it to the request to fail. As such, developers will rarely get into this situation since Amplify CLI will only create the conflict resolution enabled API by asking if the API should be enabled for DataStore.

@lawmicha lawmicha added feature-request Request a new feature and removed enhancement labels Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API category datastore Issues related to the DataStore category feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

4 participants