Page MenuHomeElementl

[dagit] Stop diffing schema.graphql during build

Authored by dish on Jun 4 2021, 2:30 PM.



We currently fail the build if the build-generated schema.graphql mismatches the diff, in an effort to guard against bad GraphQL usage. However, since all of our GraphQL consumption occurs with TypeScript types, this diff check is unlikely to be necessary. That is, any usage of GraphQL types should have extensive TypeScript coverage anyway, so if there are problems, re-generating types and running TypeScript should be sufficient to catch any problems with stale types.

We can therefore stop checking in schema.graphql, and stop diffing it during the build. It can be generated for the purposes of checking TS and lint, and otherwise not necessary to keep. If there are problems with staleness, the TS check should be sufficient.

I have also combined download-schema and generate-types into a single generate-graphql command, as I'm not aware of an existing need for download-schema independent of generating TS types and the possibleTypes JSON file.

Test Plan

Run yarn generate-graphql from packages/core, verify success. Add a bogus type to a query, re-run, verify failure.

Run tox locally with the bogus type in place, verify failure. Remove the bogus type, verify success.

Diff Detail

R1 dagster
Lint Not Applicable
Tests Not Applicable

Event Timeline


Generate GraphQL artifacts before checking TS and running Jest.

Makes sense to me - there's an internal version coming too i assume

This revision is now accepted and ready to land.Jun 4 2021, 3:17 PM

Yeah, will follow up with that.