HomePhabricator

Fix invalid + unrecoverable subselection state in Dagit (#1924)

Authored by bengotow on Nov 29 2019, 5:37 PM.

Description

Fix invalid + unrecoverable subselection state in Dagit (#1924)

Summary:
It turns out Apollo's useQuery has some very unintuitve defaults - when the variables provided to the query change, it changes which value it retrieves from it's normalized store (using the new variables) but does NOT automatically make another network request if the data is not present.

This meant it was very easy to load pipeline A, switch to pipeline B, and see "invalid selection" because pipeline B's solid selection query result was null.

Changing the fetch policy to network-only forces Apollo to retrieve actual results when the variables change. It's not ideal, but their other possible mode (fetch-and-network) briefly shows the results for the OLD pipeline A while fetching pipeling B, which is also awful.

I'm separately going through to verify this isn't the source of other problems elsewhere. In this diff I also added progress spinners to make the loading states prettier.

Test Plan: Updated snapshots

Reviewers: #ft, schrockn

Reviewed By: #ft, schrockn

Subscribers: schrockn

Differential Revision: https://dagster.phacility.com/D1508

Details

Committed
bengotowNov 29 2019, 6:43 PM
Reviewer
Restricted Project
Differential Revision
D1508: Fix invalid + unrecoverable subselection state in Dagit (#1924)
Parents
R1:bc15d2a1ad38: Fix typeahead suggest token values, autoselect first completion
Branches
Unknown
Tags
Unknown