Open plevavas opened 3 years ago
+1 I prefer JSON config over YML and this extension doesn't seem to work with it.
maybe a simple glob and support for multiple configs (mono repositories like nx)
import {sync} from 'fast-glob';
const configs = sync(`${firstWorkspaceDirectory()}/**/codegen.{yml,yaml}`)
Creating a Record<string, CodegenContext>
where each codegen config holds their context.
for example:
{
"apps/my-frontend/codegen.yml": {...},
"libs/other/lib/codegen.yml": {...},
...
}
The codegen.yml
could then use workspace relative paths:
# libs/other/lib/codegen.yml
generates:
libs/invotheroice/lib/src/:
preset: near-operation-file
plugins:
- typescript-operations
- typescript-urql
# apps/my-frontend/codegen.yml
generates:
apps/my-frontend/src/:
preset: near-operation-file
plugins:
- typescript-operations
- typescript-urql
@patryk-smc this extension should now be able to load all extensions supported by codegen in version 0.9.6
I will add a config for custom path in 1.0.0
Thanks for this extension!
Graphql-codegen cli uses cosmiconfig to load config file. It would be great if we could set custom config path.