-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
DataStore with @auth - subscriptionError ... MissingFieldArgument: Missing field argument editors #7069
Comments
Thanks for opening the issue with excellent details @hmisonne! Unfortunately, having an array of owners with DataStore isn't currently supported due to how AppSync handles owner based auth with an array of owners and how the subscriptions need to be created. This is a limitation we're aware of, and we are currently working on updating the documentation to more accurately reflect any potential limitations you might run into with DataStore right now like this. With that said, I'd recommend exploring static group authorization to see if you are able to address your use case in a similar way. We will continue to track this issue and provide any updates here. |
Thanks @amhinson, I looked at the static group authorization, but unfortunately it won't work for my use case. I really hope that this new feature will be available soon! |
Unfortunately I ran into the same problem. I have a multi-tenant application that should allow data editing for some users dynamically. By design, there is no way to achieve this functionality with static groups because the authorization changes from record to record. Do you recommend to leave the Datastore way for now @amhinson ? |
@hmisonne @giulio-dds can you give us more specifics on your use cases? This will help us give feedback to the AppSync service team so that we can better convey the requirements into their roadmap for 2021. |
Hi @undefobj , In my use case, I am building a Grocery List App for shoppers who want to share and update a grocery list. Having just one owner is not compatible with my concept since I need multiple users to get access to one grocery list. Not having the The only way I found to work around this issue was to use SelectiveSync, but it comes with a lot of challenges:
|
Hi @undefobj , we are developing a browser based ERP for transport logistics in Amplify + React.js. ERP owners (i.e. carriers) can receive orders from their customers through an app (Amplify + React Native) which allows read, writing and updating of shipment information recorded on an Orders table in DynamoDB. Customers and carriers must be able to update the status and details of orders, based on the flow of logistics during transport (tracking, customer feedback, courier notifications, goods transported, invoicing, etc.). It would be easy with static groups if the ERP were for a single company, however in our case we have a network of carriers (with their customers) and the informations recorded in the table must necessarily be dynamic with multiple level of authorization to optimize the access and security of the data. In a few words, all carrier's tenants (managed by cognito group auth) and customer specific user, have access to the order record and in both cases they can perform read, write and update operations. |
I ran into the same issue and implemented a workaround. You can see the details here aws-amplify/amplify-cli#4794 (comment) In a gist, you need an alternative to get your notifications somewhere else (since it's impossible to subscribe based on an array filter), and you need to hack/modify the DataStore to inject incoming messages from your alternate subscription. I have a version of the DataStore that allows passing in an Observable object. This custom observable serves as a replacement of the failing subscriptions due to the |
If it helps get this prioritized, I'll add my use case, which seems to be roughly similar to some of the other ones listed here: near-real time sync of information stored in one instance of an object with a group of users, only one of whom has Create/Delete permission. The expected number of groups will exceed the number supported by Cognito, so my understanding is that I have to use a |
This is also a limitation for my use case. We're creating a tool where groups of people collaborate on projects. It works fine so far with the non-Datastore API (String array of userIDs per project as owner field), but we were really keen on upgrading to Datastore for the offline features, cascading mutations, more intuitive API, etc. We'll be really happy when this becomes available. :) |
Describe the bug
I built a React Native App and I am following the amplify docs to add owner authorization. I am using
withAuthenticator
to register and sign in users through AWS Cognito.Adding an
@auth
rule to a model with multiple editors will throw a subscription Error :Having just one owner won't generate any errors.
To Reproduce
Steps to reproduce the behavior:
Run
amplify update api
,amplify push
,npm run amplify-modelgem
Run the app locally and see the error (I am using a "GroceryList" model instead of "Draft"):

Expected behavior
I am expecting the app to run without errors
Code Snippet
What is Configured?
Output of running
npx envinfo --system --binaries --browsers --npmPackages --npmGlobalPackages
Environment:
The text was updated successfully, but these errors were encountered: