{"id":21565218,"url":"https://github.com/mastercloudapps-projects/rest-grpc-graphql","last_synced_at":"2025-04-10T13:08:50.672Z","repository":{"id":104936488,"uuid":"276056707","full_name":"MasterCloudApps-Projects/REST-gRPC-GraphQL","owner":"MasterCloudApps-Projects","description":"This project aims to provide a high level analysis and comparison between several API styles","archived":false,"fork":false,"pushed_at":"2020-12-12T21:58:06.000Z","size":367,"stargazers_count":24,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:45:56.184Z","etag":null,"topics":["api","graphql","hateoas","openapi","rest","restful"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MasterCloudApps-Projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2020-06-30T09:35:05.000Z","updated_at":"2025-01-05T21:35:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"5111e507-c82a-4a65-ad81-c90cb8534c8c","html_url":"https://github.com/MasterCloudApps-Projects/REST-gRPC-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/MasterCloudApps-Projects%2FREST-gRPC-GraphQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterCloudApps-Projects%2FREST-gRPC-GraphQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterCloudApps-Projects%2FREST-gRPC-GraphQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterCloudApps-Projects%2FREST-gRPC-GraphQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MasterCloudApps-Projects","download_url":"https://codeload.github.com/MasterCloudApps-Projects/REST-gRPC-GraphQL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248224514,"owners_count":21068073,"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":["api","graphql","hateoas","openapi","rest","restful"],"created_at":"2024-11-24T10:18:53.373Z","updated_at":"2025-04-10T13:08:50.666Z","avatar_url":"https://github.com/MasterCloudApps-Projects.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST, gRPC and GraphQL\n\nThis project is an attempt to gather the foundations of three common API Styles –REST, gRPC and GraphQL. It also works as a guide on how each one of these styles tackles some everyday usage cases.\n\n## Demo project\nSee [implementation project](src/)\n\n## Project description\n1. [Introduction](docs/apis_introduction.md)\n2. [REST](docs/rest.md)\n3. [GraphQL](docs/graphql.md)\n4. [gRPC](docs/grpc.md)\n\n### Comparison table\n\n| Usage                              | REST                                                                      | GraphQL                                       | gRPC                                                          |\n|------------------------------------|---------------------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------|\n| [Contract][]                       | HATEOAS or OpenAPI                                                        | GraphQL Schema Language: operations           | Protocol Buffers: rpc                                         |\n| [Schema definition][]              | Resource oriented.\u003cbr /\u003eHTTP response headers, Media Type and JSON Schema | Graph oriented.\u003cbr /\u003eGraphQL Schema Language  | Resource and Action oriented.\u003cbr /\u003eProtocol Buffers: messages |\n| [Standard methods][]               | `GET`, `POST`, `PUT`, `PATCH`, `DELETE`                                   | `query` and `mutation`                        | Through rpc operations                                        |\n| [Get][]                            | `GET`                                                                     | `query`                                       | `Get` rpc operation                                           |\n| [Get (representation)][]           | ✔️ Content Negotiation                                                     | ✘ Only JSON                                   | ✘ only one. Default: Protocol Buffers                         |\n| [Get (custom)][]                   | Sparse fieldsets. Embedded resources                                      | Native support                                | `FieldMask`                                                   |\n| [List][]                           | `GET`. Custom pagination, sorting and filtering                           | `query`. Standard pagination and sorting      | `List` and `Search` rpc operations                            |\n| [Create][]                         | `POST` or `PUT`                                                           | `mutation`                                    | `Create` rpc operation                                        |\n| [Update][]                         | `PUT`                                                                     | `mutation`                                    | `Update` rpc operation (unrecommended)                        |\n| [Partial update][]                 | `PATCH`                                                                   | ✘ Workarounds                                 | `Update` rpc operation with `FieldMask`                       |\n| [Delete][]                         | `DELETE`                                                                  | `mutation`                                    | `Delete` rpc operation                                        |\n| [Custom methods][]                 | HATEOAS or `POST`                                                         | pure functions: `query`, other: `mutation`    | Custom rpc operation                                          |\n| [Long-requests][]                  | Resource `operation`                                                      |                                               | Interface `Operation`                                         |\n| [Error handling][]                 | Native in HTTP. Extensible                                                | `errors` property. Extensible                 | Standard errors. Google Error Model                           |\n| [Security][]                       | HTTP: Bearer, OAuth, CORS, API Keys                                       | HTTP: Bearer, OAuth, CORS, API Keys           | TLS, ALTS, token-based (Google), custom                       |\n| [Subscriptions][]                  | Unsupported. WebHook and HTTP streaming                                   | `subscription`                                | HTTP/2 streaming                                              |\n| [Caching][]                        | HTTP, application and local cache                                         | `GET`, application and local cache            | Application and local cache                                   |\n| [Discoverability][]                | HATEOAS and `OPTIONS` or OpenAPI                                          | Native introspection                          | ✘ autogenerated client code                                   |\n\n## Additional resources\nThis project was born as a Master's Dissertation. You can check:\n\n* 📖 [Essay (Spanish)](https://docs.google.com/document/d/1ldtcUz1kc_hQfbPyKY89YCCbSBH3ixZyTRLi_dX0DjA/edit)\n* 🖼 [Slides (Spanish)](https://docs.google.com/presentation/d/1EMAOWbFpjjY3Zs9sdgdGa_lTynidE-upeEsLGu1KMDk/edit#slide=id.gb057fc3acf_0_45)\n\n[Contract]: docs/usage/contract.md\n[Schema definition]: docs/usage/schema_definition.md\n[Standard methods]: docs/usage/methods.md\n[Get]: docs/usage/method_get.md\n[Get (representation)]: docs/usage/method_get#representation.md\n[Get (custom)]: docs/usage/method_get#custom-fetching.md\n[List]: docs/usage/method_list.md\n[Create]: docs/usage/method_create.md\n[Update]: docs/usage/method_update.md\n[Partial update]: docs/usage/method_update_partial.md\n[Delete]: docs/usage/method_delete.md\n[Custom methods]: docs/usage/method_custom.md\n[Long-requests]: docs/usage/long_running_operation.md\n[Error handling]: docs/usage/error_handling.md\n[Security]: docs/usage/security.md\n[Subscriptions]: docs/usage/subscriptions.md\n[Caching]: docs/usage/caching.md\n[Discoverability]: docs/usage/discoverability.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastercloudapps-projects%2Frest-grpc-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmastercloudapps-projects%2Frest-grpc-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastercloudapps-projects%2Frest-grpc-graphql/lists"}