-
Notifications
You must be signed in to change notification settings - Fork 825
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
Error: Only one resolver is allowed per field #682
Comments
Same thing here :-( |
Same thing here. I tried adding a keyField to a connection (#300 (comment)) and I get the following error:
So I deleted a table and all it's connections, and then tried to re add it, which gave me the following error:
The resolver does not seem to be in the AppSync Console anymore, so the only way I see is to delete the stack (as suggested in the forum posted above) which is really not an option for me. |
It seems there is some path that leaves APIs in a state where a resolver is left dangling even after the field is removed from the schema. When this happens you can get around the issue by going to the AppSync console, adding a field to the schema with the same name as the supposed conflict, delete the resolver record by selecting it from the right half of the schema page and clicking "Delete Resolver" on the resolver page. I will try to reproduce and identify the underlying issue but it appears that it is not within the Amplify CLI itself. |
Got the same error today, also renamed my connection and got the error Only way I could correct it was to remove the two models which had the connection (first made a backup of data in DynamoDB), push it so all was removed and then push the model without connection in it so it recreated the schema, resolvers and table and after that re-made the connection |
@mikeparisstuff trick worked for me, but really annoying. Hope it will be fixed soon! |
I had the same issues. Appsync is not always perfectly in sync I guess :P |
Same problem here as well, it happened to me when I tried to rename a Resolver. It seems like the renamed resolver is created by CF before the old resolver is removed and therefore raises this exception. @sprucify solution works but this needs to be fixed as it's not viable in the long run |
@pierremarieB Was the resolver that you added, a custom resolver? |
@kaustavghosh06 It was a regular resolver. Not sure what you mean by custom resolver. |
I have had this problem when I create models with keys defined and connections within them. If you leave the connections out and first deploy (amplify push), then once thats done, add your connections and it works. |
Update: Fixed it. I created an entry in |
@pierremarieB wrote:
We've run into the same on more than one occasion when renaming a resolver. Attempting to deploy both the old and newly named resolvers, by pointing the old resolver to a blackhole field name, also did not work; CF appears to process creations before deletes and updates. Our current CI/CD approach is to deploy a delete and then deploy the creation of the resolver again under the new name. |
Hit this as well :/ Unfortunate that CF cannot process this as an override. |
This happened to me on two different scenarios: When I'm trying to create a many to many relationshipI simple followed the docs. When I updated the
|
I ran into this issue yesterday. After 2 hours I just gave up and deleted the API, I couldn't resolve the issue. This was testing only, so not really an issue. For production ready API's i'm a little more concerned. Since I've tried every trick in this issue without result, can anyone point me to the file(s) which causes the issue? Or do I have to dig into CloudFormation? Thanks. |
I ran into a similar situation We had a GraphQL type named So upon the next deploy, it would throw the error Oddly, I wasn't able to remove the resolvers through the
So then I decided to try and create the missing type ChangeInCondition and see if I could then remove the resolver. Yep, that did the trick. Funny how creating the "missing type" worked. I thought it would throw an error at the API level. Here it is in Python using boto3...
|
Same issue! |
ABSOLUTELY DO NOT DO THIS IF YOU HAVE DATA IN YOUR DYNAMODB DATABASE. This will delete all tables and remove all data. This can only work if your project is in a very early stage and does not have data already. |
Yes you are right. I should have mentioned this in my reply. You will lose everything. And I am in early stage so this works for me. |
I found a solution for this error without losing the data. Do the following actions for the affected types:
Good luck! |
I also experienced this issue. |
Working perfectly. |
I had lot of errors that persisted even after losing the data. Try to either run the app on incognito mode (this can be annoying) or remove all data for localhost from setting from time to time. Especially if you are getting lots of errors. |
I created a new environment and ran into this issue. I commented out the |
@yonatanganot I tray this solution but the next error appear: |
Yep - I get the same here. Since you removed the operations (queries, mutations) on the model you run into this error.
I think this issue will avoid most of the problems here (hopefully): #2384 |
@iqaldebaran @regenrek |
@yonatanganot , my schema is the next... type TKRProject type WhatIf |
My solution for my problem... without delete data... was:
Other better solution: |
Raised this as an issue on the AppSync community too - aws/aws-appsync-community#128 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. Please open a new issue if you are still encountering problems. |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
The following GraphQL-Schema leads to the Error "Only one resolver is allowed per field" when pushed to the AWS Cloud.
The generated Resolver and CloudFormation looks good to me. The Resolvers seems to be unique per Type and Field.
We had to rename the non-collection property to something else so the resolver could be deployed:
I don't know if this is a CloudFormation or a Amplify CLI Bug. There is a Forum Post (https://forums.aws.amazon.com/thread.jspa?messageID=884492󗼌) which I replied to because this can be that CloudFormation Bug. But since I use the Amplify CLI, I wanted to bring this up, even if it's just for documentation.
The text was updated successfully, but these errors were encountered: