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

Appsync Events API with Existing Amplify Config #3025

Closed
akilisosa opened this issue Nov 15, 2024 · 6 comments
Closed

Appsync Events API with Existing Amplify Config #3025

akilisosa opened this issue Nov 15, 2024 · 6 comments
Assignees
Labels
data-schema question Further information is requested

Comments

@akilisosa
Copy link

Amplify CLI Version

12.13.0

Question

I am trying to use AWS APPSync Event API - however it involves doing a Amplify.config step.

I think there is an error or something. I tried this in gen1 and in gen2.

The documentation says to do something like this:

import config from './amplify_events_outputs.json';

Amplify.configure(config);

but there are already existing values that i need so i tried to do this instead:

import outputs from '../../amplify_outputs.json';
import config from './amplify_events_outputs.json';

Amplify.configure({...outputs, 
...config
});

It seems like I can have one or the other not both, but one has my other api amplify settings that i set up.

Again i tried this in gen1 and gen2

@akilisosa akilisosa added pending-triage question Further information is requested labels Nov 15, 2024
@akilisosa akilisosa changed the title Appsync Events. Appsync Events API with Existing Amplify Config Nov 15, 2024
@chrisbonifacio
Copy link
Member

Hi @akilisosa thanks for raising this issue.

Are you referring to the steps on this page?

https://docs.amplify.aws/react/build-a-backend/data/connect-event-api/

@chrisbonifacio chrisbonifacio self-assigned this Nov 15, 2024
@chrisbonifacio chrisbonifacio added pending-community-response Issue is pending a response from the author or community. and removed pending-triage labels Nov 15, 2024
@akilisosa
Copy link
Author

akilisosa commented Nov 15, 2024

Yes. However I am trying it with the angular framework. (lol i should switch to react since there is such a demand for it in the job market).

I did see this recommendation in the gen1 to use AWSAPPsyncClient:
https://docs.amplify.aws/gen1/angular/build-a-backend/graphqlapi/upgrade-guide/

which I can try next.

when I do it the way the documentation suggests i get the error: "did you run AWS.config()?"

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Nov 15, 2024
@akilisosa
Copy link
Author

so after fighting all the other documentation i found this one:
https://docs.aws.amazon.com/appsync/latest/eventapi/event-api-getting-started.html

and that worked for me. :P

@chrisbonifacio
Copy link
Member

oh okay! thank you for letting us know! I'll close this issue since you're unblocked but just curious what that documentation might've had that ours was missing when it comes to angular? i can create a separate task to improve the docs specifically for Angular to prevent this from happening to others using the same framework.

@chrisbonifacio chrisbonifacio removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Nov 18, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@akilisosa
Copy link
Author

@chrisbonifacio It is not angular specific. Unless - for some reason it works in react. The issue is that I would be using two end points, and amplify configure only works for one (as far as I'm aware) to get around this issue - I had to create a separate web socket connection using the traditional method wss:// etc... doing this . The documentation showed what methods i and information i needed to use and provide to set that up. If you did add that to the docs i would say something like for more advance configurations or control see this documentation...

In react - there are lots of different ways to set up the project, you might be able to do amplify.configure() in every service and get it set up that way, however if you just did it in one place at the start of the app, or in a providers component you would probably run into the same issue.

I just started working in react / redux / next.js for that other project you should see the issue i raised earlier today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-schema question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants