aws-amplify / aws-amplify/amplify-codegen

[codegen] graphql config - multiple extension outputs from a project

Open
#49 8 comments 0 reactions 0 assignees View on GitHub
feature-request p4 plugins-support
Dominant language
TypeScript
Stars
59
Forks
64
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
I want to output typescript types to lambda functions as well as my frontend application also.

**Describe the solution you'd like**
The ability to have many extensions with the same key as `amplify` within the same project:
```yml
projects:
Workspaces:
schemaPath: src/graphql/Workspaces/schema.json
includes:
- src/graphql/Workspaces/**/*.ts
excludes:
- ./amplify/**
extensions:
amplify:
codeGenTarget: typescript
generatedFileName: src/utils/API.ts
docsFilePath: src/graphql/Workspaces
maxDepth: 2
amplify:
codeGenTarget: typescript
generatedFileName: amplify/backend/foobar/API.ts
docsFilePath: amplify/backend/foobar
maxDepth: 2
extensions:
amplify:
version: 3
```

**Describe alternatives you've considered**
Having a folder in the root directory to allow types to be read from there, however it's not easy and requires extra permissions and npm won't let you read outside the main dir it's being ran from. So this will be an issue for lambda functions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.