aws-amplify / amplify-codegen

Amplify Codegen is a JavaScript toolkit library for frontend and mobile developers building Amplify applications.
Apache License 2.0
60 stars 61 forks source link

Feature Request: Use codegen in headless mode seperate from push #56

Open tyler-burkett opened 4 years ago

tyler-burkett commented 4 years ago

Is your feature request related to a problem? Please describe. When setting up the build configuration for multiple frontend environments with a shared backend, I have the need to make the build process use amplify pull to get the most up-to-date metadata to connect to the backend (e.x. the aws-exports.js file for a React webapp). However, to use any of the GraphQL statements generated by amplify codegen, it seems like I need to store a copy of the statements in each one of the frontend repositories in order to use them. It would be preferable if I could generate the statements during/after pulling to reduce manually duplicating the same files across multiple repositories.

Describe the solution you'd like I think either one of these proposed solutions would work, though the latter would most likely be easier to implement.

Describe alternatives you've considered

JeremyL71 commented 3 years ago

up :)

christo-pr commented 1 year ago

Hi all! đź‘‹ Is there any update on this? I do see there's a PR attached but is in draft now. I'm trying to use github actions to build and test my app, but it's not working since I cannot generate these files. Is there another way to have these files generated during a workflow in github? So far the Amplify auth service it's working fine but because it does have a headless interface.

I was trying to use an env variable for the app id inside of .graphqlconfig.yml file and just run amplify codegen in the action but doesn't seem to work neither, so I'm kinda stuck now.

khitrenovich commented 1 year ago

Do you need anything besides code generation from Amplify? You can use graphql-codegen to generate TS types and React hooks, if that's what's the only thing you need.

christo-pr commented 1 year ago

I don't need more than code & types generation, but does that mean that I'll need to track graphql/schema.json file? I'm not sure if I would want to track that file since its a large file, is there a way to get the file directly from amplify? like using an url?