{"id":22266808,"url":"https://github.com/jntn/functions-and-graphql","last_synced_at":"2026-03-19T22:14:09.131Z","repository":{"id":44834191,"uuid":"238887334","full_name":"jntn/functions-and-graphql","owner":"jntn","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-02T21:34:35.000Z","size":69,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T13:22:50.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/jntn.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-02-07T09:34:12.000Z","updated_at":"2020-02-07T09:34:58.000Z","dependencies_parsed_at":"2022-09-19T08:10:22.198Z","dependency_job_id":null,"html_url":"https://github.com/jntn/functions-and-graphql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jntn%2Ffunctions-and-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jntn%2Ffunctions-and-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jntn%2Ffunctions-and-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jntn%2Ffunctions-and-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jntn","download_url":"https://codeload.github.com/jntn/functions-and-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245483315,"owners_count":20622846,"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","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":[],"created_at":"2024-12-03T10:24:03.970Z","updated_at":"2026-01-06T04:47:58.011Z","avatar_url":"https://github.com/jntn.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Netlify Functions + GraphQL\n\nThis repo demonstrates how to use functions for a GraphQL API using `apollo-server-lambda`.\n\nSee the graphQL [function code](./functions/graphql.js)\n\nFor more information on functions. Checkout [functions.netlify.com](https://functions.netlify.com/) and the [Netlify functions workshop](https://github.com/DavidWells/netlify-functions-workshop#workshop-lessons)\n\n## Setup \u0026 Deployment\n\n### Easy mode:\n\nSimply click the deploy button:\n\n\u003ca href=\"https://app.netlify.com/start/deploy?repository=https://github.com/netlify-labs/functions-and-graphql\"\u003e\n  \u003cimg src=\"https://www.netlify.com/img/deploy/button.svg\"\u003e\n\u003c/a\u003e\n\n### Manual mode:\n\nFollow the steps below to set this up via the [`netlify-cli`](https://cli.netlify.com/)\n\n1. **Fork this repo**\n\n    Fork this repo and clone it down to your local machine\n\n    ```bash\n    git clone repoURL\n    ```\n\n2. **Create this site in Netlify**\n\n    Open your terminal and run the following command:\n\n    ```bash\n    netlify init\n    ```\n\n    Choose \"create \u0026 configure a new site\", then add a site name or hit enter for one to be generated for you.\n\n3. **Install our graphQL dependencies**\n\n    Change directories into our functions folder and create new package.json\n\n    ```bash\n    cd functions \u0026\u0026 npm init -y\n    ```\n\n    Now install the `apollo-server-lambda` npm package\n\n    ```bash\n    npm install apollo-server-lambda\n    ```\n\n4. **Require the graphQL dependencies in your function**\n\n    In `functions/graphql.js`, require 'apollo-server-lambda'\n\n5. **Define your GraphQL types**\n\n    In `functions/graphql.js`, define your graphQL types\n\n6. **Define your GraphQL resolvers**\n\n    In `functions/graphql.js`, define your graphQL resolvers\n\n7. **Create a new `ApolloServer`**\n\n    In `functions/graphql.js`, create a new `ApolloServer` and pass it your typeDefs and resolves\n\n8. **Export the Lambda compatible ApolloServer**\n\n    In `functions/graphql.js`, turn your server into a lambda compatible function signature\n\n    ```js\n    server.createHandler()\n    ```\n\n    Then export the handler\n\n9. **Deploy the site**\n\n    Open your terminal and run the following command:\n\n    ```bash\n    netlify deploy -p\n    ```\n\n    Open the frontend and test your new graphQL endpoint\n\n    ```\n    netlify open:site\n    ```\n\n10. **You did it! 🎉**\n\n    You should see a site like [https://graphql-functions.netlify.com/](https://graphql-functions.netlify.com/) where you can explore your graphQL schema.\n\n## Additional resources\n\n- [The Fullstack Tutorial for GraphQL](https://www.howtographql.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjntn%2Ffunctions-and-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjntn%2Ffunctions-and-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjntn%2Ffunctions-and-graphql/lists"}