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

fix(ClientApiGenFragmentTestv2.kt): fragment name projection #549

Merged
merged 1 commit into from
May 3, 2023

Conversation

coleturner
Copy link
Contributor

This change fixes an issue where the codegen results in two Projection generated objects that share the name when used for union types as well as field projections.

Example schema:

type Query {
   videos: Video
   bestMovie: Movie
}

type Movie {
   title
}

type Show {
   title
}

union Video = Movie | Show

Because Movie is used both as a field and as a union type, when codegen generates projection objects for each, they will result in the same MovieProjection and only one file will be written to disk. What this change does is it renames the projection objects used in fragments, so that they can be written to disk separately.

Copy link
Contributor

@srinivasankavitha srinivasankavitha left a comment

Choose a reason for hiding this comment

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

Looks great!

@coleturner coleturner merged commit ffef604 into master May 3, 2023
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