- Newest
- Most votes
- Most comments
Hello,
From your query, I understand that you would like to use the Document table directly without configuring the DataStore for it. You have tried to configure the DataStore configuration for syncExpression on the table to prevent the syncing of the data. However, you are observing the error on subscription for the generated schema.
Please note that, unfortunately, at the moment, the disabling of DataStore for a specific model is not supported in Amplify applications. DataStore can be enabled or disabled for the entire Amplify project at once using the amplify update api
command. There is an active feature request with Amplify service team on this issue. You can track this FR on the same GitHub issue. It also mentions the workaround of disabling the sync as you mentioned. We can leverage the same workaround to prevent the DataStore sync of the table.
Having said that, for the error you are observing, this is being returned as the subscriptions are not being generated for the Document model. I tried replicating this warning in my sample application however, I did not received this error. To further investigate on this, we would need to check if there is no subscription connection being established for the Document model. For more information, please refer subscribing to data.
I hope you find above information helpful. In case you require further assistance specific to the above error being observed, please share if the subscription connection is being established from the application. You may also reach out to us via a Support case.
Have a nice day ahead!
Hi @Shadab_A, I was thinking today, that what if I don't even need the GraphQL API for that model. All work with it is done through custom backend code on Node.js. I save the data through AWS SDK DynamoDB API, and query it on client only through my custom NodeJS endpoints and the OpenSearch AppSync API generated from the @searchable.
Can I than skip the table on front-end by the workaround I mentioned at the github issue[1]?
(in short, simply by removing the model from the scheme before running amplify codegen models
)
Or will it have some other impact that I don't see at the moment?
[1] - https://github.com/aws-amplify/amplify-js/issues/10062#issuecomment-1531139785
Relevant content
- Accepted Answerasked 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
Hello,
Thank you for writing back.
In case you generate the models using the method defined in the GitHub issue, it may work until the changes are not being make to the GraphQL API or the command amplify codegen model. These would generate the models again and might cause issues in future. This has been addressed by Amplify service team on the GitHub comment: https://github.com/aws-amplify/amplify-js/issues/10062#issuecomment-1531636954
Let me know in case you have any follow up questions!