{"id":15292833,"url":"https://github.com/eaceto/regraphql","last_synced_at":"2025-05-07T05:11:41.777Z","repository":{"id":42431736,"uuid":"478200313","full_name":"eaceto/ReGraphQL","owner":"eaceto","description":"A simple (yet effective) GraphQL to HTTP / REST router","archived":false,"fork":false,"pushed_at":"2023-02-25T09:45:12.000Z","size":226,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T05:11:36.958Z","etag":null,"topics":["degraphql","graphql","graphql-server","http","http-server","kong","proxy","rest-api","reverse-proxy"],"latest_commit_sha":null,"homepage":"https://eaceto.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eaceto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-05T15:54:34.000Z","updated_at":"2022-12-12T14:35:45.000Z","dependencies_parsed_at":"2024-06-19T23:04:39.060Z","dependency_job_id":null,"html_url":"https://github.com/eaceto/ReGraphQL","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":"0.32352941176470584","last_synced_commit":"830a50c5e286d5b74bd6aa29ffb6f8a4a29f234c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FReGraphQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FReGraphQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FReGraphQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FReGraphQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eaceto","download_url":"https://codeload.github.com/eaceto/ReGraphQL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252817647,"owners_count":21808707,"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":["degraphql","graphql","graphql-server","http","http-server","kong","proxy","rest-api","reverse-proxy"],"created_at":"2024-09-30T16:27:48.083Z","updated_at":"2025-05-07T05:11:41.753Z","avatar_url":"https://github.com/eaceto.png","language":"Go","readme":"# ReGraphQL\n\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/eaceto/ReGraphQL)\n\n![Docker Image Version (latest semver)](https://img.shields.io/docker/v/eaceto/regraphql?color=red\u0026label=Docker%20Image%20version)\n![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/eaceto/regraphql?color=red\u0026label=Docker%20Image%20size)\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/eaceto/ReGraphQL/Go?label=GitHub%20CI)\n\n**A simple (yet effective) GraphQL to REST / HTTP router**.\n\nReGraphQL helps you expose your GraphQL queries / mutations as  REST / HTTP endpoints.\nDoing this has the following benefits:\n\n* Queries are stored and controlled server side. No queries on the frontend.\n* Can modify and optimise your queries on demand without redoploying your (frontend) clients\n* Can use GET (HTTP Method) instead of GraphQL's POST\n* It's an OSS alternative to [Kong's DeGraphQL](https://marcoam-patch-3--kongdocs.netlify.app/hub/kong-inc/degraphql/)\n \nIt helps you going...\n\n**From this** \n````graphql\nquery($person: StarWarsPeople!) {\n\tgetPerson(person: $person) {\n\t\tbirthYear\n\t\teyeColors\n\t\tfilms {\n\t\t\ttitle\n\t\t}\n\t\tgender\n\t\thairColors\n\t\theight\n\t\thomeworld {\n\t\t\tname\n\t\t}\n\t\tmass\n\t\tname\n\t\tskinColors\n\t\tspecies {\n\t\t\tname\n\t\t}\n\t\tstarships {\n\t\t\tname\n\t\t}\n\t\tvehicles {\n\t\t\tname\n\t\t}\n\t}\n}\n````\n\n**To**\n````http request\nGET /persons/{person}\n````\n\n# Index\n* [Requirements](#requirements)\n* [Features](#features)\n* [Service Endpoints](#service-endpoints)\n* [Quick start](#quick-start)\n* [Docker Image](#docker-image)\n* [Contributing](#contributing)\n* [License](#license)\n* [Author](#author)\n\n## Requirements\n\n* Go 1.18\n\n## Features\n\n- [x] Maps HTTP params to GraphQL Variables\n- [x] Forwards HTTP headers to GraphQL request\n- [ ] Set HTTP Status Code different to 200 if GraphQL query fails.\n- [ ] Hide GraphQL Error's **Locations**\n- [ ] Hide GraphQL Error's **Stacktrace**\n- [ ] Hide GraphQL Error's **Path** \n- [x] Reads configuration from **.env** file\n- [x] Reads configuration from **environment variables**\n- [x] Logs using Kubernetes' [**klog**](https://github.com/kubernetes/klog) v2\n- [x] Docker Image below 20MB\n- [X] Exposes metrics using [Prometheus](https://prometheus.io/)\n- [X] Exposes Liveness, Readiness and Startup Probes \n\n## Service Endpoints\n\n### Liveness\n\n````http request\nGET /health/liveness\n\n{\"hostname\":\"pod_67804\",\"status\":\"up\"}\n````\n\nReturns HTTP Status Code **OK** (200) with the following JSON as soon as the application starts\n````json\n{\"hostname\":\"\u003c\u003c hostname \u003e\u003e\",\"status\":\"up\"}\n````\n\n### Readiness\n\n````http request\nGET /health/readiness\n\n{\"hostname\":\"pod_67804\",\"status\":\"ready\"}\n````\n\n1. If the application is **Ready** to receive requests\n\nReturns HTTP Status Code **OK** (200) with the following JSON:\n````json\n{\"hostname\":\"\u003c\u003c hostname \u003e\u003e\",\"status\":\"ready\"}\n````\n\n2. If the application is **Not Ready** to receive requests\n\nReturns HTTP Status Code **Precondition Failed** (412) with the following JSON:\n````json\n{\"hostname\":\"\u003c\u003c hostname \u003e\u003e\",\"status\":\"waiting\"}\n````\n\n### Metrics\n\nThe service exposes a [Prometheus](https://prometheus.io/) metrics endpoint at **/metrics**\n\n````http request\nGET /metrics\n\n# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.\n# TYPE go_gc_duration_seconds summary\ngo_gc_duration_seconds{quantile=\"0\"} 0\ngo_gc_duration_seconds{quantile=\"0.25\"} 0\ngo_gc_duration_seconds{quantile=\"0.5\"} 0\ngo_gc_duration_seconds{quantile=\"0.75\"} 0\ngo_gc_duration_seconds{quantile=\"1\"} 0\ngo_gc_duration_seconds_sum 0\n````\n\n## Quick start\n\n1. Describe a route in a file using **yaml**, which matches your HTTP endpoint with your GraphQL endpoint and Query \n\n````yaml\nroutes:\n    - http:\n          uri: '/persons/{person}'\n          method: GET\n      graphql:\n          endpoint: 'https://swapi.skyra.pw/'\n          query: |\n              query($person: StarWarsPeople!) {\n                  getPerson(person: $person) {\n                      birthYear\n                      eyeColors\n                      films {\n                          title\n                      }\n                      gender\n                      hairColors\n                      height\n                      homeworld {\n                          name\n                      }\n                      mass\n                      name\n                      skinColors\n                      species {\n                          name\n                      }\n                      starships {\n                          name\n                      }\n                      vehicles {\n                          name\n                      }\n                  }\n              }\n````\n*File* **starwars.yml**\n\n2. Copy **starwars.yml** into **/tmp/config**\n\n3. Run the service (using Docker Compose)\n````shell\n[sudo] docker-compose up\n````\n\n4. Query your new HTTP endpoint!\n````shell\ncurl 'http://127.0.0.1:8080/graphql/persons/lukeskywalker' --compressed\n````\n\n## Docker Image\nDocker image is based on Google's Distroless. The final image is around 11.2MB and packs only the necessary things to run the service.\n\n````shell\ndocker pull eaceto/regraphql:latest\n````\n\n## Contributing\nBefore contributing to ReGraphQL, please read the instructions detailed in our [contribution guide](CONTRIBUTING.md).\n\n## License\nReGraphQL is released under the MIT license. See [LICENSE](LICENSE) for details.\n\n## Author\nCreated by [Ezequiel (Kimi) Aceto](https://eaceto.dev).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feaceto%2Fregraphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feaceto%2Fregraphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feaceto%2Fregraphql/lists"}