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

Initial work on a new flow target #296

Merged
merged 34 commits into from
Nov 13, 2017

Conversation

lewisf
Copy link

@lewisf lewisf commented Nov 9, 2017

This new flow target uses babel 7 nodes to generate the resulting code. As a result, it does not extend the existing CodeGenerator.

Not having to print strings allows the code to be a little bit cleaner and makes managing the typescript target easier too.

New current defaults (subject to potential change depending on discussion):

  • This new target exports nested types
  • Multiple files in a __generated__ folder co-located by default
    • it seems more reasonable to be able to say import { MyQuery_hero } from './__generated__/MyQuery' than import { MyQuery_hero } from '../../../../types/graphql_operations`

Organizationally, I've decided to co-locate tests in __tests__ folders. Not married to this but I found it easier to work with.

Still TODO:

  • figure out how to consolidate the printer here w/ the existing CodeGenerator
  • strategy for custom scalars
  • solidifying api contract
  • optional exact objects

The new typescript target will require few changes from the flow target code (i've tried this already, but don't want to submit it along with the flow target until it's complete)

@lewisf
Copy link
Author

lewisf commented Nov 12, 2017

@martijnwalraven this branch is getting pretty big so I'd love to commit this work to master before continuing work on this new flow target.

It'll be accessible via a different target name "flow-modern".

I did some minor changes to the CLI, please double check those!

cc @dquang-tran who helped out with some of this work

@martijnwalraven martijnwalraven merged commit f3e6fa4 into apollographql:master Nov 13, 2017
ecstasy2 added a commit to ecstasy2/apollo-codegen that referenced this pull request Dec 22, 2017
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.

None yet

2 participants