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

Codegen args root #578

Merged
merged 3 commits into from
Sep 5, 2020
Merged

Conversation

galales
Copy link
Contributor

@galales galales commented Sep 4, 2020

This PR closes #560

Fix misalignment in arguments type names also at schema root levels (Query, Mutation and Subscription).
All arguments types names are now generated using the same function, so there should not be other similar issues.

The function prepends the "parent" name to the arguments type, in order to avoid possible duplications.

Note: names generated since this version will be different from the previous ones.

Example

The schema

type Query {
   user(id: Int): User!
}

type Mutation {
   setMessage(message: String): String!
}

is now generated as

case class Query(
   user: QueryUserArgs => zio.UIO[User]
)

case class Mutation(
   setMessage: MutationSetMessageArgs => zio.UIO[String]
)

while in the previous versions was

case class Query(
   user: UserArgs => zio.UIO[User]
)

case class Mutation(
   setMessage: SetMessageArgs => zio.UIO[String]
)

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for getting to the bottom of this!

@ghostdogpr ghostdogpr merged commit b9148c9 into ghostdogpr:master Sep 5, 2020
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.

[CodeGen] Arguments name do not match for root level operation
2 participants