aws-amplify / aws-amplify/amplify-codegen

Better defaults for .graphqlconfig.yml

Open
#48 2 comments 1 reaction 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.**
Amplify codegen dumps it's graphql all over the place like an itinerant toddler.

**Describe the solution you'd like**
Dump all the generated code for an api in a folder named for the API

```yaml
projects:
{ApiName}:
schemaPath: src/{ApiName}/schema.json
includes:
- src/{ApiName}/**/*.ts
excludes:
- ./amplify/**
- src/{ApiName}/types.ts
extensions:
amplify:
codeGenTarget: typescript
generatedFileName: src/{ApiName}/types.ts
docsFilePath: src/{ApiName}
extensions:
amplify:
version: 3
```

There could even be some barrels for importing convenience
```typescript
// {ApiName}/index.ts
export * from './mutations'
export * from './queries'
export * from './subscriptions'
export * from './types'
```

```typescript
// index.ts
export * as {ApiName} from './ {ApiName}'
```

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.