openneuro
openneuro copied to clipboard
refactor(graphql): Generate types for GraphQL schemas
Adds automatic type generation using graphql-codegen.
This is a work in progress because it requires giving queries and mutations unique names. I fixed openneuro-client but not the other packages to try things out.
TODO:
- [ ] Fix all the overlapping/anonymous queries/mutations in the CLI and React packages.
- [ ] Have CI verify the generated types match the committed version
- [ ] Decide if we want to generate separate types for each package or just stick them all in @openneuro/client or a new utility package.
- [ ] Document how to update types (pretty much just
yarn codegen)