FSharp.Data.GraphQL icon indicating copy to clipboard operation
FSharp.Data.GraphQL copied to clipboard

Comparison with GraphQL.NET

Open cmeeren opened this issue 3 years ago • 8 comments

Currently checking out if GraphQL is a good fit for us. Have no prior experience.

Using F#, so of course FSharp.Data.GraphQL gets bonus points for being focused on F#. But I also see that GraphQL.NET seems more popular (not surprising since it's C#), more feature-rich (e.g. has built-in support for sandboxes like GraphiQL), in some ways more convenient (supports other useful scalar types out of the box), and due to its popularity generally seems like a "safer" choice.

Do you (or anyone else) have any experience with both FSharp.Data.GraphQL and GraphQL.NET and can point to some important differences?

One thing I'm concerned about is performance. If FSharp.Data.GraphQL uses async for all fields etc. internally, performance could be significantly worse. (I had that problem with Felicity, and got an order-of-magnitude improvement after i changed to Hopac internally).

cmeeren avatar May 07 '21 05:05 cmeeren

@cmeeren I am not answering the exact question but I would add HotChocolate to the equation, especially if performance is important. It's a very powerful tool with both server and client support, plus browser IDE (Banana Cake Pop, comes out of the box with server). Feature rich, actively developed and supported.

They are not focused on F# but they start talking about improving support/design for F#, too. Yet development in F# is possible indeed. Some server sample project (not theirs) -- https://github.com/adelarsq/hotchocolate_fsharp_sample

All in all, having evaluated GraphQL.NET and HotChocolate, we went with HotChocolate and we are happy. I personally value FSharp.Data.GraphQL for ad-hoc client scripting, with F# unique data provider features.

nightroman avatar May 07 '21 06:05 nightroman

Hey guys, I find myself in the same situation now as @cmeeren when he opened his issue. About half a year later, maybe any of you can share any lessons learned so far? I'd love to choose the best option here among the three options HotChocolate/FSharp.Data.GraphQL/graphql-dotnet. Thanks in advance.

knocte avatar Feb 01 '22 06:02 knocte

As I understand HotChocolate has quite good support and evolved well. However, it is completely object-oriented. So that if you look at the functional approach it is not for you.

Banana Cake Pop should be language agnostic on .NET. But I have not tried yet.

In general, I have a standard project template that I use. I've already incorporated #332 and I created #324. I hope that with @nikhedonia and @mickhansen we will merge that stuff soon and prepare solution templates for ASP.NET Core and Azure Functions that will also contain Banana Cake Pop

They are not focused on F# but they start talking about improving support/design for F#, too. Yet development in F# is possible indeed. Some server sample project (not theirs) -- https://github.com/adelarsq/hotchocolate_fsharp_sample

I've reviewed it but comparing to this implementation it not so good for F# developers.

One thing I'm concerned about is performance. If FSharp.Data.GraphQL uses async for all fields etc. internally, performance could be significantly worse. (I had that problem with Felicity, and got an order-of-magnitude improvement after i changed to Hopac internally).

I think we need to rethink this approach. At least to use asyncResult

xperiandri avatar Mar 08 '22 17:03 xperiandri

@cmeeren v2 was released with a lot of cool features. The sample includes the use of Banana Cake Pop

xperiandri avatar Apr 05 '24 04:04 xperiandri

Congratulations! Happy to hear it. F# needs a solid GraphQL library.

As for me, I'm now using HotChocolate, which seems sufficiently far ahead of FSharp.Data.GraphQL in terms of functionality and active development that I would rather use that and put up with its friction with F#. YMMV, of course.

cmeeren avatar Apr 05 '24 08:04 cmeeren

The blessing and curse of F# - you get to choose between an FP library with a small community or an OOP library with a large community!

njlr avatar Apr 05 '24 12:04 njlr

FSharp.Data.GraphQL is better, though 🙂. I chose it over HotChocolate because I was so much faster getting a GraphQL service up and running with it than with HotChocolate. With the latter, I had to go through an extensive documentation which shows how to do X, Y and Z in a hundred different ways with hundred different defaults and this and that... Less (meaning straightforward) is often more.

valbers avatar Apr 05 '24 12:04 valbers

I can take another look. If FSharp:Data.GraphQL could support SSE (Server-Sent Events), I'd be one step closer to choosing it. And #460 would help, too!

In any case, this API is intended to live for decades, so a big and active community/userbase is a big plus for us. Getting up and running quickly is not a primary concern.

cmeeren avatar Apr 05 '24 13:04 cmeeren