Reputation: 2513
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
Reputation: 1755
Since this question was first asked, there are several different options to help you with this solution. Some of your options include:
IQueryable
directly to graphql.Upvotes: 4
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