Hi,
In « Mapping & Combining » section in elm-graphql/Graphql-SelectionSet
document page, I read:
Note: If you run out of
mapN
functions for building upSelectionSet
s, you can use the pipeline which makes it easier to handle large objects, but produces lower quality type errors.
The syntax with map2
:
hero : SelectionSet Hero StarWars.Object.Human
hero =
SelectionSet.map2 Human
Human.name
Human.id
The syntax with « Pipelines »:
hero : SelectionSet Hero StarWars.Object.Human
hero =
SelectionSet.succeed Human
|> with Human.name
|> with Human.id
Excluding |> with
the 2 code look alike.
Question: does the map2
function bring only a check on the number of fields advantage?
Best regards,
Stéphane