tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

0.10: GraphQL typing ignores load option

Open bmulholland opened this issue 3 years ago • 3 comments

We have a mutation with an argument that uses GraphQL's loads option, which auto-fetches objects by their ID.

It looks like this: argument :party_ids, [ID], loads: Types::PartyType, as: :parties

The type of the argument coming in to resolve is then T::Array[Party], but the new compiler thinks they're still T::Array[String]

cc @jeffcarbs -- just an FYI, no expectation that you fix this, thanks for the work!

bmulholland avatar Sep 08 '22 12:09 bmulholland

Seems like this is fixed by https://github.com/Shopify/tapioca/pull/1556

fazo96 avatar Oct 27 '23 07:10 fazo96

Seems like this is fixed by #1556

@fazo96 I think current graphql_mutation compiler resolves to something like T::Array[Types::PartyType] instead of T::Array[Party]

xinyifly avatar May 23 '24 08:05 xinyifly

That's true @xinyifly I have noticed the same behavior recently

fazo96 avatar May 31 '24 08:05 fazo96