Closed yegenpres closed 1 year ago
Hi @yegenpres I have transferred this issue to the CLI repo, as it appears that this issue may be more CLI related, than Android specific.
Hey @yegenpres :wave: thanks for raising this! If you have modified your Node.js package to ESM by specifying "type": "module"
in your package.json
you can simply copy the generated codegen files to the relevant Lambda layer. If you are using CommonJS (i.e. with require
) you can continue to use the suggested Babel path and modify the npm script to read from src/main/graphql
Closing due to inactivity
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Before opening, please confirm:
Language and Async Model
Kotlin
Amplify Categories
GraphQL API
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
https://docs.amplify.aws/guides/functions/appsync-operations-to-lambda-layer/q/platform/android/#set-up-your-layer
Describe the bug
I follow all steps in docs many times in different project generated on CLI or Console, also try Ios and Android projects and receive the same result.
after this command: npm run updateAppsyncOperations
I did not receive generated js files in opt directory of lambda layer. Instead received schemes GraphQL in src.main directory of Android app.
Folloved guide I placed script in ./package.json file: "scripts": { "updateAppsyncOperations": "amplify api gql-compile && amplify codegen && babel src/graphql --config-file ./babel.config.json -d ./amplify/backend/function/testawsapappsyncOperations/opt/graphql/" }
and made ./babel.config.jsom : { "presets": [ [ "@babel/env", { "targets": { "node": "12" } } ] ] }
that is my console output: ✅ GraphQL schema compiled successfully.
Edit your schema at ./testProjects/kmm_app/testAwsAnd/amplify/backend/api/testawsap/schema.graphql or place .graphql files in a directory at ./testProjects/kmm_app/testAwsAnd/amplify/backend/api/testawsap/schema ✔ Generated GraphQL operations successfully and saved at src/main/graphql/com/amazonaws/amplify/generated/graphql babel: src/graphql does not exist
Reproduction steps (if applicable)
No response
Code Snippet
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response