You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dillonkearns I'd like to start with thanking you for the great library.
Today for the first time I tried using elm-graphql.
I admit this a great library and it helped a lot.
I am trying to get my company to start using Elm.
Part of that is educating others and introducing them to Elm.
So I am writing this down to lower the entry barrier.
My expectations
I am starting to build a new App, and prepared a query using graphiQL ie. {offers(order_by:{...}) { id name stock {quantity ...}}.
Then I turned to elm-graphql to generate the code. I expected the result would look something like:
moduleApi.Requestexposing (fetchOffers,Data,Offers)
type alias Data={ offers:ListOffers, errors:...}type alias Offers={
id:String, name:String, stock:ListStock...}fetchOffers baseUrl (ResultErrorData->Msg)=-- generated implementation using SelectionSets and all the details if i decided to write the query by hand
Since the generator didn't ask for a query I knew this would have to be done by hand.
And something that took a few minutes in graphiQL turned into a few hours teaching myself how to write a the same query using the generated code.
Feedback at this point is that:
code generation was super simple
writing the queries using "dsl" was challenging, it required quite a bit of Elm knowledge, and I don't see how someone new to the language would manage
code generation stopped one step away from the same great experience graphiQL provides
Amount of generated code
I am using hasura as the graph server.
After the code was generated It took me a while to explore the generated code to understand how it was structured and how to use it.
At this point, I was overwhelmed because the schema is very rich with plenty of options.
Going back to my use-case where I only needed a small subset of what was actually available.
Feedback:
I understand that this is required in the scenario where the user writes the code by hand
using the generated types.
The cognitive load at this step is high. I can't help it feel that this goes against the idea of graphQL.
Order_by
The model/schema I am using is big 10-20 field.
As a result Table_order_by type contains 20 OptionalArgument Api.Enum.XX_by.Order_by
The normal use-case is probably order_by: { col1: asc, col2: desc} with 1-2 columns.
I wasn't able to find a default with all columns set to Absent that would allow {default | col1: desc}
And writing this by hand was ... not the best experience.
Overall I feel this library is great.
But I don't feel that I can use it as part of a workshop targeted at people new to Elm.
The text was updated successfully, but these errors were encountered:
@dillonkearns I'd like to start with thanking you for the great library.
Today for the first time I tried using elm-graphql.
I admit this a great library and it helped a lot.
I am trying to get my company to start using Elm.
Part of that is educating others and introducing them to Elm.
So I am writing this down to lower the entry barrier.
I am starting to build a new App, and prepared a query using graphiQL ie.
{offers(order_by:{...}) { id name stock {quantity ...}}
.Then I turned to elm-graphql to generate the code. I expected the result would look something like:
Since the generator didn't ask for a query I knew this would have to be done by hand.
And something that took a few minutes in graphiQL turned into a few hours teaching myself how to write a the same query using the generated code.
Feedback at this point is that:
I am using hasura as the graph server.
After the code was generated It took me a while to explore the generated code to understand how it was structured and how to use it.
At this point, I was overwhelmed because the schema is very rich with plenty of options.
Going back to my use-case where I only needed a small subset of what was actually available.
Feedback:
I understand that this is required in the scenario where the user writes the code by hand
using the generated types.
The cognitive load at this step is high. I can't help it feel that this goes against the idea of graphQL.
The model/schema I am using is big 10-20 field.
As a result
Table_order_by
type contains 20OptionalArgument Api.Enum.XX_by.Order_by
The normal use-case is probably
order_by: { col1: asc, col2: desc}
with 1-2 columns.I wasn't able to find a default with all columns set to
Absent
that would allow{default | col1: desc}
And writing this by hand was ... not the best experience.
Overall I feel this library is great.
But I don't feel that I can use it as part of a workshop targeted at people new to Elm.
The text was updated successfully, but these errors were encountered: