We are a team that generate and version control our auto generated type files for typescript and it seems bit random if single or double quotes are used in the files.
We use apollo codegen command.
Can we somehow force one way or the other?
Hey @fondberg - I’ve got a couple options for you.
-
The
apollo
CLI in its current form isn’t actively maintained and on its way to deprecation. Codegen isn’t supported in its successor, Rover, either. Many people have had great results usinggraphql-code-generator
, so this would be my recommendation. It seems at a glance that their output uses single quotes. -
If you’re using an npm script to run the CLI, consider chaining a call to
prettier
after the generation is complete (specifying only the generated types file as a target) - this gives you a lot of control over the formatting of your generated file via aprettier
config.
Hope that’s helpful. Let me know if I left anything unanswered
Thanks. AFAIK Rover is more tied to the studio right? Is it possible to run without the studio?
Generally speaking, it is more tied to Studio, yes. There is some base functionality which doesn’t require Studio (introspection and composition).