{"id":19201100,"url":"https://github.com/dabit3/apollo-server-in-amplify-function","last_synced_at":"2025-11-17T15:29:30.926Z","repository":{"id":49920426,"uuid":"252568202","full_name":"dabit3/apollo-server-in-amplify-function","owner":"dabit3","description":"How to deploy an Apollo Server with Amplify Functions","archived":false,"fork":false,"pushed_at":"2021-06-08T09:24:30.000Z","size":2248,"stargazers_count":13,"open_issues_count":14,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-08T22:08:15.872Z","etag":null,"topics":["apollo","aws-amplify","aws-lambda","graphql","javascript","react","serverless"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dabit3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-02T21:28:32.000Z","updated_at":"2023-02-17T08:15:23.000Z","dependencies_parsed_at":"2022-09-16T12:01:45.031Z","dependency_job_id":null,"html_url":"https://github.com/dabit3/apollo-server-in-amplify-function","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dabit3/apollo-server-in-amplify-function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fapollo-server-in-amplify-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fapollo-server-in-amplify-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fapollo-server-in-amplify-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fapollo-server-in-amplify-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dabit3","download_url":"https://codeload.github.com/dabit3/apollo-server-in-amplify-function/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fapollo-server-in-amplify-function/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284911546,"owners_count":27083422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-17T02:00:06.431Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","aws-amplify","aws-lambda","graphql","javascript","react","serverless"],"created_at":"2024-11-09T12:36:38.535Z","updated_at":"2025-11-17T15:29:30.911Z","avatar_url":"https://github.com/dabit3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apollo server running in an Amplify Function\n\nThis is an example of how to deploy an Apollo GraphQL Server in an Amplify Function\n\nThere are two options to follow along with this example. You can either create this project from scratch by following the tutorial, or you can deploy this project itself with a couple of commands from the Amplify CLI\n\n## Tutorial\n\nTo create this from scratch, please see the dev.to tutorial [here](https://dev.to/aws/10-minute-tutorial-deploy-an-apollo-graphql-server-with-amplify-functions-38p1).\n\n## Deploy this project\n\nTo deploy this full stack serverless project, follow these steps.\n\n1. Clone the project, change into the folder, install dependencies\n\n```sh\n$ git clone https://github.com/dabit3/apollo-server-in-amplify-function.git\n\n$ cd apollo-server-in-amplify-function\n\n$ npm install\n```\n\n2. Initialize and deploy the Amplify back end\n\n```sh\n$ amplify init\n\n$ amplify push --y\n```\n\n3. Run the app\n\n```sh\n$ npm start\n```\n\n## The server\n\nThe server is located in the Lambda handler at __amplify/backend/function/apolloserver/src/index.js__\n\nHere is what you get out of the box:\n\n```js\nconst { ApolloServer, gql } = require('apollo-server-lambda');\n\n/* Construct a schema, using GraphQL schema language */\nconst typeDefs = gql`\n  type Query { hello: String }\n`;\n\n/* Provide resolver functions for your schema fields */\nconst resolvers = {\n  Query: {\n    hello: () =\u003e 'Hello from Apollo!!',\n  },\n};\n\nconst server = new ApolloServer({\n    typeDefs,\n    resolvers,\n    context: ({ event, context }) =\u003e ({\n      headers: event.headers,\n      functionName: context.functionName,\n      event,\n      context,\n    }),\n  });\n\nexports.handler = server.createHandler({\n  cors: {\n    origin: '*',\n    credentials: true,\n  },\n});\n```\n\n## Modifying the schema\n\nTo create a custom schema, update the `typeDefs` definition and add your types, queries, mutations, and subscriptions.\n\n## Adding a database\n\nIf you'd like to add a persistence layer, you can easily add DynamoDB to this app by using the `storage` category.\n\n```sh\n$ amplify add storage\n\n\u003e Choose DynabDB Database + your preferred options\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabit3%2Fapollo-server-in-amplify-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdabit3%2Fapollo-server-in-amplify-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabit3%2Fapollo-server-in-amplify-function/lists"}