Giter VIP home page Giter VIP logo

Comments (9)

oyed avatar oyed commented on September 20, 2024 1

Other than this small issue, I've successfully set this up now - and it's working great! I had a few pain points with the implementation, which I'll create a separate issue/PR for, but all seems to be working well on my stack:

  • Working along-side Apollo Server for Query/Mutation
  • Took some fiddling but the stack set-up on AWS CDK seems to be complete
  • Works well with graphql-codegen generated subscription hooks

When I get a little more time, I'll write a small example and PR it to demonstrate Apollo + AWS CDK usage

from subscriptionless.

oyed avatar oyed commented on September 20, 2024 1

The reason the domain name and stage isn't currently configurable is because connections are (I believe) unique to a given domain/stage.

Correct - however when developing locally, proxying or just wanting a domain infront of the WS API Gateway, allowing an option for designating the URL is required (Breaks my local dev, requires using a dynamic WS URL instead of a static custom domain)

from subscriptionless.

IonelLupu avatar IonelLupu commented on September 20, 2024 1

I can't think of a reason why we would want to attempt to message on a socket via an API that isn't the one that established the connection - do you have any more info on why you might want to do this?

@andyrichardson @oyed In my case, when developing on a local environment (localhost), API Gateway posts a message using the 443 port instead of my port (which is 3001 in my case right now) on which my localhost environment is running on. Would be nice to have a way to set the endpoint host and/or port manually so it can work in this scenario.

As a test, I manually edited the node_modules files of subscriptionless to make it work by adding the "http" and my port but then I get another error:

Error [UnknownError]: Not Found
    at Object.extractError (.\node_modules\aws-sdk\lib\protocol\json.js:52:27)
    at Request.extractError (.\node_modules\aws-sdk\lib\protocol\rest_json.js:49:8)
    at Request.callListeners (.\node_modules\aws-sdk\lib\sequential_executor.js:106:20)
    at Request.emit (.\node_modules\aws-sdk\lib\sequential_executor.js:78:10)
    at Request.emit (.\node_modules\aws-sdk\lib\request.js:686:14)
    at Request.transition (.\node_modules\aws-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (.\node_modules\aws-sdk\lib\state_machine.js:14:12)

Out of curiosity, how do you work with this library locally @andyrichardson ?

from subscriptionless.

andyrichardson avatar andyrichardson commented on September 20, 2024

Hey @oyed thanks for the report and feedback!

The reason the domain name and stage isn't currently configurable is because connections are (I believe) unique to a given domain/stage.

I can't find any documentation confirming or contradicting this assumption but let me know if you are seeing otherwise.

I can't think of a reason why we would want to attempt to message on a socket via an API that isn't the one that established the connection - do you have any more info on why you might want to do this?

from subscriptionless.

andyrichardson avatar andyrichardson commented on September 20, 2024

Took some fiddling but the stack set-up on AWS CDK seems to be complete

Feel free to share your config - happy to merge in a CDK (or CF?) example if its not super straight forward.

from subscriptionless.

andyrichardson avatar andyrichardson commented on September 20, 2024

A little late to this but to answer your question - the majority of my time has been working on this in a deployed environment.

Out of curiousity, what values is your development setup (serverless framework I'm guessing) giving you for the domain name here?

from subscriptionless.

IonelLupu avatar IonelLupu commented on September 20, 2024

hey @andyrichardson unfortunately I don't work on that project anymore and I don't have access to it 😞

from subscriptionless.

oyed avatar oyed commented on September 20, 2024

@andyrichardson I use a custom solution locally, combined with lambda-local, though for me the most "enticing" idea here is a custom domain for the WebSocket APIG

from subscriptionless.

andyrichardson avatar andyrichardson commented on September 20, 2024

unfortunately I don't work on that project anymore and I don't have access to it disappointed

@IonelLupu no worries 👍

I use a custom solution locally

@oyed I'd be curious to see what you're cooking up! I need to invest some time looking into this because - as I mentioned - I haven't worked much with the local development tooling for mocking APIGateway.

The main thing I'm not quite understanding is why the tooling wouldn't set the domainName on the event to correspond to the mocked endpoint.

In the meantime, you could try this and let me know if it solves your issue.

from subscriptionless.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.