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

Feedback for “Multi Project” #10289

Open
patrickDouglas opened this issue Feb 11, 2025 · 1 comment
Open

Feedback for “Multi Project” #10289

patrickDouglas opened this issue Feb 11, 2025 · 1 comment

Comments

@patrickDouglas
Copy link

If you want to run graphql-codegen across all of your projects, is it expected you have to run graphql-codegen --config graphql.config.js --project prj1 and then graphql-codegen --config graphql.config.js --project prj2? My initial thought was that I could just run graphql-codegen, and it would run all the projects 🤔, but that does NOT seem to be the case. Is there anyway to add a flag like... --all-projects which would loop over each project and run graphql-codegen based on it's configuration?

@eddeee888
Copy link
Collaborator

Hi @patrickDouglas ,

That is a spot on observation. Codegen currently only runs one project at a time.

A few options come to mind right now:

  1. Use one project, if all current projects need to run at the same time
  2. Write a wrapper script that runs multiple projects sequentially or parallelly: This can be done fairly straightforward on the consumer side e.g. to run sequentially: graphql-codegen --config graphql.config.js --project prj1 && graphql-codegen --config graphql.config.js --project prj2. However, if you start to get more than a few projects, it could become efficient
  3. Make Codegen CLI do option 2 OOTB: There are a lot to consider in this option: would projects run in parallel? Would failing one project continue? What is the terminal output if multiple projects run at the same time?

I've a feeling option 3 would need a lot of work, and 1 or 2 would be a quicker workaround if you need to unblock yourself. If you have suggestions/proposals for option 3 or other options, I'm more than happy to discuss!

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

No branches or pull requests

2 participants