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

Generates data fetcher interface for query types #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zaenk
Copy link

@zaenk zaenk commented May 8, 2021

The Java generator has an option to generate example data fetchers that can be copied into the codebase and extended as needed, but the kotlin generator has no such option.

This PR implements example data fetcher generator for kotlin with a twist: instead of generating a a class with TODO bodies, it generates an interface, for now.

This is the first in a series of PRs that would add an option similar to OpenAPI kotlin-spring generator interfaceOnly option.

Interfaces generated by this way would only be usable if the example output directory is set to the generated code directory. However, the generated interfaces would not be useable until Netflix/dgs-framework#320 is resolved.

The final solution would enable the development of schemas in a separate repository. Automation would use this generator to generate data classes for types and interfaces for data fetchers and mutations that server component must implement. The generated sources would be packaged and published as a jar. in the final solution, this interface generation behavior would get it's own configuration option/flag.

The current PR introduce just enough change that would enable me to further experiment with code generation in small iterations without diverging much from the mainline.

edit: elaborates scope, links blocker PR in dsg-framework

@ilterpehlivan
Copy link

Hi,
This PR would be answering my question here ? Netflix/dgs-framework#308 (comment)

Thanks

@zaenk
Copy link
Author

zaenk commented Dec 7, 2021

@ilterpehlivan yes, essentially it does, original discussion: Netflix/dgs-framework#234

@zaenk zaenk force-pushed the feature/generate-kotlin-data-fetchers-from-queries branch 2 times, most recently from 9408681 to 4ed5f96 Compare December 7, 2021 20:45
@zaenk zaenk force-pushed the feature/generate-kotlin-data-fetchers-from-queries branch from 4ed5f96 to 5bb5f5e Compare December 7, 2021 20:51
@zaenk
Copy link
Author

zaenk commented Dec 8, 2021

rebased, tests are now passing

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