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: Generate @lazy fields with abstract effect #2064

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

johnspade
Copy link
Contributor

Hello!

We use a heavily customized version of the Caliban code generator at $Work and would like to contribute back some of our changes. Caliban recently added support for the @lazy directive, the point of this PR is to improve its support for code with abstract effect (F[_]). Codegen currently generates code that won't compile due to a missing abstract type parameter in case classes:

type Foo {
  bar: String!
  baz: String! @lazy
}

object Types {
  final case class Foo(bar: String, baz: F[String])
}

This PR adds a couple tests and changes for object and nested lazy fields generation.

@johnspade johnspade marked this pull request as ready for review January 3, 2024 22:45
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.

Thanks for the improvements!

@ghostdogpr ghostdogpr merged commit 12ccf23 into ghostdogpr:series/2.x Jan 5, 2024
10 checks passed
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