{"id":18798634,"url":"https://github.com/liteobject/demo.graphql","last_synced_at":"2026-05-17T00:08:43.593Z","repository":{"id":90788582,"uuid":"533342863","full_name":"LiteObject/Demo.GraphQL","owner":"LiteObject","description":"Demo GraphQL with C#","archived":false,"fork":false,"pushed_at":"2023-07-01T17:20:38.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T19:14:11.767Z","etag":null,"topics":["api","csharp","graphql","hotchocolate"],"latest_commit_sha":null,"homepage":"","language":"C#","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/LiteObject.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-06T13:42:24.000Z","updated_at":"2023-07-08T14:27:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"28ea998d-f7c9-4cd3-af67-d359492be094","html_url":"https://github.com/LiteObject/Demo.GraphQL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LiteObject/Demo.GraphQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FDemo.GraphQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FDemo.GraphQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FDemo.GraphQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FDemo.GraphQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiteObject","download_url":"https://codeload.github.com/LiteObject/Demo.GraphQL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2FDemo.GraphQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001894,"owners_count":26083226,"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-10-09T02:00:07.460Z","response_time":59,"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":["api","csharp","graphql","hotchocolate"],"created_at":"2024-11-07T22:12:32.309Z","updated_at":"2025-10-09T18:39:23.331Z","avatar_url":"https://github.com/LiteObject.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo GraphQL with C#\n\u003e GraphQL is a query language for API, and a server-side runtime for executing queries using a type system define for data. GraphQL isn't tied to any specific database or storage engine and is instead backed by existing code and data.\n\n![GraphQL logo](https://graphql.org/img/og-image.png)\n\n\u003eGraphQL is a new API standard that provides a more efficient, powerful, and flexible alternative to REST. It was developed and open sourced by Facebook and is now maintained by a large community of companies and individuals from all over the world.\n\n![Example](https://graphql-engine-cdn.hasura.io/learn-hasura/assets/graphql-react/graphql-on-http.png)\n\nAt its core, GraphQL enables declarative data fetching where a client can specify exactly what data it needs from an API.\n\nInstead of multiple endpoints that return fixed data structures, a GraphQL server only exposes a single endpoint and responds with precisely the data that a client asked for.\n\n## Tools\n- [Prisma](https://www.prisma.io/) creates tools and that replaces traditional ORMs. Prisma enriches the GraphQL ecosystem and community by creating high-quality tools and software.\n- [Hasura](https://hasura.io/) is an open source engine that connects to your databases \u0026 microservices and auto-generates a production-ready GraphQL backend. Hasura gives you realtime GraphQL APIs that are high-performance, scalable, extensible \u0026 secure (with authorization baked in).\n\n## GraphQL vs REST API\nOver-Fetching and Under-Fetching\n\n\n```html\napi/users/{id}\napi/users/{id}/posts\napi/users/{id}/followers\n```\n\n---\n## There are two libraries to expose GraphQL endpoint:\n- :trophy:[graphql-dotnet/graphql-dotnet](https://graphql-dotnet.github.io/docs/getting-started/introduction/)\n- :star:[ChilliCream/hotchocolate](https://github.com/ChilliCream/hotchocolate/blob/main/website/src/docs/hotchocolate/get-started.md)\n   - STEP #1: `dotnet add package HotChocolate.AspNetCore`\n   - STEP #2: Define the types\n   - STEP #3: Add a Query type\n   - STEP #4: Add GraphQL services\n     ```csharp\n     builder.Services\n        .AddGraphQLServer()\n        .AddQueryType\u003cQuery\u003e();\n     ```\n   - STEP #5: Map the GraphQL endpoint \n     ```csharp\n     var app = builder.Build();\n     // map GraphQL\n     app.MapGraphQL();\n     app.Run();\n     ```\n\n---\n\n## Operations: GraphQL vs REST\n\n|Operation| GraphQL | REST |\n|:---|:---|:---|\n| Read | Query | GET |\n| Write | Mutation | PUT, POST, PATCH, DELETE |\n| Event | Subscription | N/A |\n\n---\n## Links:\n- [The Fullstack Tutorial for GraphQL](https://www.howtographql.com/)\n- [Code using GraphQL](https://graphql.org/code/#c-net)\n- [Next-generation Node.js and TypeScript ORM](https://www.prisma.io/)\n- [Hasura](https://hasura.io/)\n- [github.com/graphql/graphql-playground](https://github.com/graphql/graphql-playground)\n- [GraphQL for .NET](https://github.com/graphql-dotnet/graphql-dotnet)\n- [ChilliCream/hotchocolate-examples](https://github.com/ChilliCream/hotchocolate-examples)\n- [ChilliCream/graphql-workshop](https://github.com/ChilliCream/graphql-workshop)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fdemo.graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliteobject%2Fdemo.graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fdemo.graphql/lists"}