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 subscription support #1352
Comments
👋🏾Thanks for opening your first issue here! Be sure to follow the issue template! ✌🏾 |
Hey @Sunac, do you have (or know about) a publicly available graphql server using aws appsync that I could use for testing the implementation for this? |
A branch has been created with changes that could potentially resolve this issue. However, there isn't a proper appsync setup to use to test that the implementation works as expected. If you have an app sync implementation that can be used, that would help move this along. |
Thanks @imolorhe !! Unfortunatelly, this project is not publicly available but will try to get some that could be used. |
@Sunac I've deployed the changes with AppSync integration here: https://s18767-altair-imolorhe.surge.sh/ Please test the changes and let me know if it works.
|
@imolorhe I am looking for something like that. I have tried to test your integration, but it returns
I am trying to connect mine one which is using JWT |
@joseph-so nice that you're testing it. I need it. Could you provide more of the error stack? |
@imolorhe ,
I have followed https://docs.aws.amazon.com/appsync/latest/devguide/real-time-websocket-client.html to get up the authentication header as
I have put the above JSON into the Collection parameters in the Subscription URL I have also set up the corresponding in the HTTP Header, so I can confirm the value is correct (I can get the Query and the Schema Document working) P.S. I am looking for a simple way to confirm the AppSync developed by my colleague is correct before I start to write my own code.
|
@joseph-so For the appsync subscription, I'm making use of https://github.com/awslabs/aws-mobile-appsync-sdk-js You should only need to set the connection parameters with something like this:
.. and provide the same graphql endpoint as the URL in Altair and the subscription URL as well. You shouldn't need to set any headers. You should have the URLs as If it's possible, you could also checkout the simolorhe/implement-app-sync-subscription-provider branch locally and run Altair locally (from packages/altair-app). That would yield better error stacks that would be better to debug with. You could also end up debugging yourself.
|
@imolorhe |
I don't think it only works with the API_KEY authentication type. What I'm just saying is that the data you pass in the connection parameters should be a valid aws export config |
@imolorhe YOU'RE THE BEST 🥇 Sorry, I was off for several days and spotted it today. Tested it and looks fine 👍 |
Awesome! Thanks for confirming @Sunac! Was it straightforward to work with? Are there any things to take note of? Can you post a snapshot of the valid config you used (remove sensitive aspects replaced with dummy before posting)? I'd need to add that to the docs and ensure things are working as expected (since I can't test or use it myself 😅 ) |
@imolorhe Thank you! So, to start receiving subscriptions this was enough. Didn't try yet to optimize the config but this works fine :). It could be mentioned that the client uses MQTT over WebSockets (checked network) as full mutation payload is received and not only the selection set from my subscription as you can see in the response. That could be useful.
|
Thanks for sharing. I'll most likely be using these screenshots as-is in the docs as well 🙂 |
Now in v3.0.0 |
Hi @imolorhe, I have spent sometimes to understand the code and found out that you have allowed apiKey to be passed but not the jwtToken. That is the reason why I got the authentication fail. I have created a new issue and pull request for you to review. Thanks a lot |
@joseph-so awesome! I'll take a look. |
I think that more and more people use AppSync nowadays, so it would be great to support its subscription via Altair as well.
Tried to set it and finally when in the subscription URL is put wss but with AppSync endpoint and not with the realtime URL
I got some response but says
Error during WebSocket handshake: Unexpected response code: 404
With the realtime URL receives:
Both, the "header", and the "payload" query string parameters are missing
Also found this one #417 but seems it has been closed with no solution.
Am I doing something wrong or it's not supported yet?
The text was updated successfully, but these errors were encountered: