Skip to content

Better defaults for .graphqlconfig.yml #48

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

Open
dopry opened this issue Jan 12, 2021 · 2 comments
Open

Better defaults for .graphqlconfig.yml #48

dopry opened this issue Jan 12, 2021 · 2 comments
Labels

Comments

@dopry
Copy link

dopry commented Jan 12, 2021

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

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

// {ApiName}/index.ts 
export * from './mutations'
export * from './queries'
export * from './subscriptions'
export * from './types'
// index.ts 
export * as  {ApiName} from './ {ApiName}'
@attilah
Copy link
Contributor

attilah commented Jan 12, 2021

@dopry thanks for the suggestion to summarize the proposed enhancements:

  • instead of graphql use the API name as a folder for the generated code
  • generate an index.ts as well for a simpler import usage

@AaronZyLee AaronZyLee transferred this issue from aws-amplify/amplify-cli Feb 3, 2021
@AaronZyLee AaronZyLee added amplify-codegen Issues on amplify-codegen enhancement labels Feb 3, 2021
@gruckionvit
Copy link

I like this idea as it allows us to isolate each API into it's own "module".

@phani-srikar phani-srikar removed enhancement amplify-codegen Issues on amplify-codegen labels Jan 30, 2022
@alharris-at alharris-at added feature-request New feature or request p4 labels Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants