Absinthe: Signature for resolve functions

Created on 7 Dec 2016  路  8Comments  路  Source: absinthe-graphql/absinthe

Hi,

I find it really hard to find the function signature for the resolve functions. I cannot find it in the API documentation and in all the samples the arguments are given as _. If someone can point me at the right documentation I will set up a pull request for the documentation (even _parent instead of _ will help). So it will be easier for the next newcomer :)

For the rest the lib is awesome, replacing a previous API with graphQL and code dissolves!

Most helpful comment

Hi @jfrolich,

You can find more information around field resolution function here (See custom resolution):

https://hexdocs.pm/absinthe/Absinthe.Type.Field.html#t:t/0

However it does not document the arity 3 resolution function which has been introduced with 1.2:

https://github.com/absinthe-graphql/absinthe/blob/master/CHANGELOG.md#resolution-functions

Also looking at the typespec, I dont think it has been updated to reflect the arity 3 resolution function either:

https://github.com/absinthe-graphql/absinthe/blob/v1.2.1/lib/absinthe/type/field.ex#L23

All 8 comments

Hi @jfrolich,

You can find more information around field resolution function here (See custom resolution):

https://hexdocs.pm/absinthe/Absinthe.Type.Field.html#t:t/0

However it does not document the arity 3 resolution function which has been introduced with 1.2:

https://github.com/absinthe-graphql/absinthe/blob/master/CHANGELOG.md#resolution-functions

Also looking at the typespec, I dont think it has been updated to reflect the arity 3 resolution function either:

https://github.com/absinthe-graphql/absinthe/blob/v1.2.1/lib/absinthe/type/field.ex#L23

Good catch, thanks! We'll update it to include the 3 arity information.

Cool 馃憦

Anyone feel like making a PR? :D I can deal with it later today if not.

Fixed in master.

I'm still having issues finding out what the parameters of the resolve function are. Where exactly should I be looking?

@dideler I believe this is what you're look for:
https://hexdocs.pm/absinthe/Absinthe.Schema.Notation.html#resolve/1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

safwank picture safwank  路  4Comments

rawkode picture rawkode  路  4Comments

tlvenn picture tlvenn  路  4Comments

futpib picture futpib  路  4Comments

futpib picture futpib  路  4Comments