Shopify / Shopify/tapioca

0.10: GraphQL typing ignores load option

Open
#1,150 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Ruby
Stars
873
Forks
164
Avg merge
4d 27m
Merged PRs (30d)
9

Description

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!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mutation example in the issue and reproduce the generated type for an argument using GraphQL's loads option. Trace how the compiler handles that argument and compare the generated type with the resolver's T::Array[Party]; done means the generated typing reflects the loaded objects instead of T::Array[String].

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, ruby
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.