Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript migration #223

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

typescript migration #223

wants to merge 7 commits into from

Conversation

acao
Copy link
Member

@acao acao commented Aug 5, 2023

redo of #191 , with a graphql upgrade as well

  • type: module so that we're using the latest and greatest in module resolution/etc
  • jest -> vitest because jest doesn't support esm well
  • vitest.config.ts contains an alias to use cjs graphql because graphql-relay doesn't publish a module bundle yet (otherwise tests have realm error)
  • tweak tests because of changes in graphql 14 -> 16, and in upstream data source values (text where number strings are expected, etc)
  • dynamic imports seemed to be the best approach for importing data
  • drop babel because it's not needed for a server side application (previously swapi was entirely clientside, so it makes sense it was there before)
  • switch from complex eslint setup to typescript eslint reccomended for simplicty
  • add github action workflow
  • replace dev scripts with netlify dev environment, which mocks the functions interface and models reverse proxy and redirect rules
  • remove everything flow related, replace with typescript
  • cache cache/data.json both in netlify and github actions for faster CI
  • note: most of the net lines of change are reflected in package-lock.json


/**
* The GraphQL type equivalent of the People resource
*/
const PersonType = new GraphQLObjectType({
const PersonType: GraphQLObjectType<Person> = new GraphQLObjectType<Person>({
Copy link
Member Author

@acao acao Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Urigo this doesn't make sense, I can't believe the type fidelity has fallen this much in graphql, migrating from flow to typescript it's even more apparent, I remember types in 14 at least had more inference, am I doing something incorrectly here?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants