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

Options for generating manifests are unclear when each should be used #3462

Open
CraigSiemens opened this issue Oct 16, 2024 · 2 comments
Open
Labels
codegen Issues related to or arising from code generation enhancement Issues outlining new things we want to do or things that will make our lives as devs easier

Comments

@CraigSiemens
Copy link
Contributor

Use case

From what I can tell, there's two different properties available that sound like they enable manifest generation

  • ApolloCodegenConfiguration.OperationManifestConfiguration.generateManifestOnCodeGeneration
  • itemsToGenerate when calling ApolloCodegen.build passing a ApolloCodegen.ItemsToGenerate

When calling ApolloCodegen.build directly, it's unclear from those properties whether they should be used together or if just one should be used since they're both passed into build.

Describe the solution you'd like

From trial and error I think that generateManifestOnCodeGeneration is only used when calling the generate command on the CodegenCLI. It'd be nice if the documentation was clearer that it only applies when using CodegenCLI.

Ideally there would be one way to enable generating manifests so the same ApolloCodegenConfiguration passed to CodegenCLI and ApolloCodegen.build would produce the same results.

@CraigSiemens CraigSiemens added the feature New addition or enhancement to existing solutions label Oct 16, 2024
@BobaFetters
Copy link
Member

I agree this is a little confusing as to what the options do, although I think the right solution here would be to add a parameter for use with the Codegen CLI to trigger manifest generation and remove the option from the configuration (deprecate initially) because the overall goal is to give users flexibility with manifest generation and currently the ApolloCodegen.ItemsToGenerate passed into the build method provide that because you can choose for any given run of codegen whether you want a new manifest, while the current codegen configuration forces it to generate everytime. So switching to a cli parameter would provide the same flexibility for CLI to choose when to generate a manifest, and if you wanted to generate one everytime then it's easy enough to just pass the parameter everytime without forcing it.

@AnthonyMDev @calvincestari thoughts?

@BobaFetters BobaFetters added enhancement Issues outlining new things we want to do or things that will make our lives as devs easier codegen Issues related to or arising from code generation and removed feature New addition or enhancement to existing solutions labels Oct 17, 2024
@AnthonyMDev
Copy link
Contributor

I think that approach makes sense to me! Seems like an improvement on what I originally designed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Issues related to or arising from code generation enhancement Issues outlining new things we want to do or things that will make our lives as devs easier
Projects
None yet
Development

No branches or pull requests

3 participants