-
Notifications
You must be signed in to change notification settings - Fork 568
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
[Feature request] Support Zeit Now v2 lambda #537
Comments
Any news on this? Would love to keep using graphql yoga with zeit since it was so simple for me to maintain / deploy |
Great issue! I'm not sure how this version of Yoga could continue to do what it does + support Now 2. Yoga currently enables subscriptions, which Now can't support, amerite? |
Due to inactivity of this issue we have marked it |
Use my fork if you want: Usage: // src/index.ts
import { GraphQLServer } from "graphql-yoga-dgt";
import resolvers from "./resolvers";
import options from "./options";
const server = new GraphQLServer({
typeDefs: "/schema.graphql",
resolvers: resolvers,
});
// same options as server.createHttpServer receives
module.exports = server.createExpressApplication(options);
// now.json
{
"version": 2,
"builds": [
{
"src": "/src/index.ts",
"use": "@now/node"
}
],
"routes": [
{ "src": "/api", "dest": "/src/index.ts" }
]
} If any mantainer likes this approach feel free to implement this or ping me for a PR |
@lucasavila00 Conseguiu pôr isto a funcionar? |
First of all I'd like to thank you for this awesome project!
I'd like to ask you to support Now v2 lambdas.
Their lambdas have a different signature than AWS.
It's like this (more info here):
It seems for me that returning "app" at this point and just exporting as module.exports would do the job.
https://github.com/prisma/graphql-yoga/blob/master/src/index.ts#L351
The idea is to create another function on the server, maybe createExpressApp or something that would return the configured express server and receive the same Options as createHttpServer receives.
This function would be used on createHttpServer up to the line 351.
I'll submit a PR for it later.
Thanks 👍
The text was updated successfully, but these errors were encountered: