JohnDoe
JohnDoe

Reputation: 2513

Turn any SQL Server database querieable through GraphQL

I have a SQL Server database. The technology stack only allows C#.

What options do I have to turn this DB queryable through GraphQL?

Upvotes: 2

Views: 8376

Answers (2)

Jonathan
Jonathan

Reputation: 1755

Since this question was first asked, there are several different options to help you with this solution. Some of your options include:

  • https://hasura.com/ allows you to connect directly to SQL Server and it will create a complete GraphQL API in front of your API. It will also give you a number ways to extend your existing application via event triggers, custom actions and some great authentication functionality.
  • Hot Chocolate - https://chillicream.com/docs/hotchocolate/ Has quickly become the go to .net library for creating graphql which includes exposing IQueryable directly to graphql.

Upvotes: 4

Vitaliy Fedorchenko
Vitaliy Fedorchenko

Reputation: 9245

Most popular implementation of Graphql parser for .NET is https://github.com/graphql-dotnet/graphql-dotnet. It is rather mature and ready for production use. However, this library can help you to parse graphql query and prepare resulting response - all the rest you'll need to implement by yourself: translate graphql query to SQL query(ies) by implementing 'entity resolvers'.

You can also check https://github.com/SimonCropp/GraphQL.EntityFramework, however usage of EntityFramework may be not very efficient for this purpose. Also there are number of commercial components that provide graphql-to-sql bridge, they also may be considered if you don't have much time to implement all these things by yourself.

Upvotes: 0

Related Questions