Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphql.Http.withOperationName argument order #254

Closed
galdiuz opened this issue Dec 4, 2019 · 1 comment
Closed

Graphql.Http.withOperationName argument order #254

galdiuz opened this issue Dec 4, 2019 · 1 comment

Comments

@galdiuz
Copy link
Contributor

galdiuz commented Dec 4, 2019

The definition of Graphql.Http.withOperationName is currently Request decodesTo -> String -> Request decodesTo, but it should probably be changed to String -> Request decodesTo -> Request decodesTo so that it's possible to chain it like the documentation for the function suggests:

query
    |> Graphql.Http.queryRequest "https://api.github.com/graphql"
    |> Graphql.Http.withOperationName "HeroNameAndFriends"
    |> Graphql.Http.send (RemoteData.fromResult >> GotResponse)

With the current definition you would have to do this:

query
    |> Graphql.Http.queryRequest "https://api.github.com/graphql"
    |> \request -> Graphql.Http.withOperationName request "HeroNameAndFriends"
    |> Graphql.Http.send (RemoteData.fromResult >> GotResponse)
@dillonkearns
Copy link
Owner

Thank you for reporting this! I pushed a fix:

https://github.com/dillonkearns/elm-graphql/blob/master/CHANGELOG-ELM-PACKAGE.md#500---2019-12-16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants