uesteibar / neuron

A GraphQL client for Elixir
https://hex.pm/packages/neuron
Other
331 stars 35 forks source link

Incorrect typespec on Neuron.query/3 #31

Closed msimonborg closed 5 years ago

msimonborg commented 5 years ago

The typespec on Neuron.query/3 states a return value of Neuron.Response.t(), but dialyzer blows up on this. The correct return type should be something like {:ok, Neuron.Response.t()} | {:error, response :: term}

uesteibar commented 5 years ago

Good catch, thanks for reporting!

Could you check if #32 fixes it for you?

msimonborg commented 5 years ago

It works! I suppose if you wanted more specific error typing it would be {:error, Neuron.Response.t() | Neuron.JSONParseError.t()}, but the current solution works well enough for me.

Thanks!

uesteibar commented 5 years ago

Nice! 🎉 actually yeah, there's no need to be more generic, so I'll switch it to that and release it

uesteibar commented 5 years ago

This has been released on v1.1.1.

Thanks for reporting it! ❤️

msimonborg commented 5 years ago

Thank you!