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

Flatten class generation #392

Merged
merged 11 commits into from
Apr 5, 2017

Conversation

sav007
Copy link
Contributor

@sav007 sav007 commented Apr 4, 2017

The issue: with nested class generation approach the nested class name can be too long, for example
UpdateCheckoutShippingAddressQuery.Data.CheckoutShippingAddressUpdate.Checkout.LineItemConnection.LineItemEdge.LineItem.Variant

Proposal: change the way how classes to be generated, so instead of fully nested classes make the structure more flat, for example:

class UpdateCheckoutShippingAddressQuery.Data {
  class CheckoutShippingAddressUpdate {...}
  class Checkout {...}
  class LineItemConnection {...}
  class LineItemEdge {...}
  class LineItem {...}
  class Variant {...}
}

This will reduce the nested levels in class names:

UpdateCheckoutShippingAddressQuery.Data.CheckoutShippingAddressUpdate
UpdateCheckoutShippingAddressQuery.Data.Checkout
UpdateCheckoutShippingAddressQuery.Data.LineItemConnection
UpdateCheckoutShippingAddressQuery.Data.LineItemEdge
UpdateCheckoutShippingAddressQuery.Data.LineItem
UpdateCheckoutShippingAddressQuery.Data.Variant

@sav007
Copy link
Contributor Author

sav007 commented Apr 5, 2017

@BenSchwab @marwanad @digitalbuddha any comments here?

Copy link
Contributor

@BenSchwab BenSchwab left a comment

Choose a reason for hiding this comment

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

👍 Thanks - this makes the generated code seem much more approachable

@sav007 sav007 merged commit 07e2c81 into apollographql:master Apr 5, 2017
@sav007 sav007 deleted the feature/flatten-class-structure branch April 5, 2017 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants