fsprojects / FSharp.Data.GraphQL

FSharp implementation of Facebook GraphQL query language.
http://fsprojects.github.io/FSharp.Data.GraphQL/
MIT License
400 stars 73 forks source link

Question: GraphQL query DSL samples? #316

Open nightroman opened 3 years ago

nightroman commented 3 years ago

The documentation page Using FSharp.Data.GraphQL on the client side mentions GraphQL query DSL and provides the code snippet. But the client-provider samples do not provide any examples.

I cannot make "strongly typed queries" working for some reasons. Namely, the property GraphQlClient.Queries does not exist. And I am not sure if something is wrong with my code or the documentation. The official GraphQL query DSL sample could help.

jberzy commented 3 years ago

@nightroman Apologies for the confusion. The Query DSL has been replaced with a newer GraphQL Type Provider. You can find examples of usage here.

nightroman commented 3 years ago

@jberzy No problem at all! Just a note (TODO?), the docs seem to be out of date.

So it looks like "typed queries" are not supported as such, right? Not a big deal perhaps with many other tools for composing GraphQL queries nowadays. I am asking just in order to be sure, not to complain :)

Please feel free to close or keep open until the docs are updated. Thank you for the great tool!

jberzy commented 3 years ago

@nightroman they are "typed queries" in the sense that the Type Provider generates types based on the string that's supplied to the MySchema.Operation<"...">() method. Moreover, the query is parsed, analyzed and validated at design-time.

Thanks, John