4 ms·
This is super awesome. Unfortunately in my company I haven't converted the mindset fully to F#, so I'm wondering, is there a good way to use this in C# somehow?
by knocte 9y ago
This is super awesome. Unfortunately in my company I haven't converted the mindset fully to F#, so I'm wondering, is there a good way to use this in C# somehow?
- j_s 9y agoYes, server-side .NET GraphQL does seem to be a missing piece right now!
- rspeele 9y agoYou can create an F# library which references the Rezoom.SQL.Provider NuGet package, defines your migrations and all your queries (`type MyQueryExample = SQL<"select whatever">`), and not really write any F# code. Because this project is a generative type provider, it makes real .NET types you can then reference from C# or VB.NET or whatever. If your goal is just to run queries, either synchronously or as `Task<T>`s, that'll do just fine. If you want the batching/caching stuff I described above, you'll want to build `Plan`s, which currently requires an F# computation expression. However, in C# 7 I think it's possible to write plans with `async/await` syntax. I just need to write the AsyncMethodBuilder to support it. I've done it for F# asyncs here: https://github.com/rspeele/FSharpAsyncMethodBuilder https://github.com/rspeele/FSharpAsyncMethodBuilder This would let you get the full batching/caching/transactional benefits of Rezoom even when writing a project that's 90% C#.