-
-
Notifications
You must be signed in to change notification settings - Fork 571
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
Added lambda adapter #1777
Added lambda adapter #1777
Conversation
🦋 Changeset detectedLatest commit: 82bf624 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great first draft! Please try and follow conventions in the other adaptors, such as putting the declaration merged types near the top of the file, using versioning for the adaptor, etc. Thanks for doing this!
I'd also like to see a cut down version of the lambda handler that only serves GraphQL and drops the GraphiQL/event stream/etc stuff.
Adding details to the documentation about how to configure the lambda via the AWS console or similar would also be great, but isn't required to get this merged.
🙌
I'd be happy to do that, but it was not clear to me what the narrowest set of cases was that I needed to handle to support bare GraphQL. I think it might be a good idea to change |
Have a look at the Fastify adaptor; it adds separate route handlers for each middleware; here's the code to just do the GraphQL part: crystal/grafast/grafserv/src/servers/fastify/v4/index.ts Lines 186 to 192 in 85dbd6d
(You can choose to not pass the
Indeed, it has crystal/grafast/grafserv/src/core/base.ts Lines 43 to 44 in 85dbd6d
All |
Are you able to address the CI issues (looks like TypeScript isn't happy), or do you need guidance? |
What I need is lunch 🙂 |
I gave up on trying to do this for now. There's too much going on between
Given the structure of the code right now, it's far easier to keep calling |
2ac43e5
to
4aed271
Compare
Now's the time to refactor this code; before we reach 5.0.0 - if it's hard to do right now, that hints that it needs to be reworked. As you can probably tell it's already been reworked quickly a few times, and the result is a bit of a mess - really someone needs to cleanly separate the concerns in the newest pattern and then rewrite everything to fit that. My plan was to add as many different adaptors as we can to determine what these shared needs are, and then refactor based on that so that each adaptor can get smaller and smaller. But I totally understand if you don't have time to take on that work! Just saying you're welcome to do it if you're inclined - just keep me abreast of any large changes since they're harder to review (we may end up splitting some of them into separate PRs). |
4aed271
to
310571a
Compare
Yeah, I'm not saying I don't want to do it, I am saying I don't want to fold it into this PR 🙂 This PR is on the critical path to adopting v5 at work, and the refactor is not. |
I'm happy with this. Please:
Then we're good to go I think? |
@benjie lgtm ty |
I'll aim to release this tomorrow, but no promises. |
Description
Lambda adapter for Grafserv (no WebSockets support)
Todo: validate that the example code works outside of Postgraphile.
Performance impact
N/A
Security impact
N/A
Checklist
yarn lint:fix
passes.yarn test
passes.RELEASE_NOTES.md
file (if one exists).