-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Codgen docs #13
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
Codgen docs #13
Conversation
cli/codegen.md
Outdated
|
|
||
| # AWS Amplify CLI codegen configuration & Workflow | ||
|
|
||
| Codegen helps you generate native code for iOS and android, generation of types for Flow and Typescript. It can also generates GraphQL statements(queries, mutations and subscriptions) so that you doesn't have to hand code them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android (cap "A") and TypeScript (cap "S") should be used everywhere.
cli/codegen.md
Outdated
|
|
||
| Codegen `add` workflow triggers automatically when an AppSync API is pushed to the cloud. You will be prompted if you want to configure codegen when an AppSync API is created and if you opt-in for codegen, subsequent pushes prompts you if they want to update the generated code after changes get pushed to cloud. | ||
|
|
||
| When an project is configured to generate code with codegen, it stores all the configuration `.graphqlconfig.yml` file in the root folder of your project. Codegen behind the scene use [`amplify-graphql-docs-generator`](https://www.npmjs.com/package/amplify-graphql-docs-generator) to generate the GraphQL statements and [`aws-appsync-codegen`](https://www.npmjs.com/package/aws-appsync-codegen) to generate the types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuth can you chat with @mlabieniec on the aws-appsync-codegen reference here? I get that it works like this now but really we want to pull this package in (or port over the code) for maintainability so maybe not point to this otherwise customers will look to that code for issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this for now and update the docs when we move away/port aws-appsync-codegen just so that the users know whats happening. When we port aws-appsync-codegen we can post a big banner in the repo saying this repo is no longer maintained and they should use the new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is, we've already started with a banner there. Let's talk timeline with Mike on the other stuff.
cli/codegen.md
Outdated
|
|
||
| ## amplify add codegen | ||
| ``` | ||
| $ amplify add codgen [--apiId <api-id>] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...note that if you use the --apiId flag to add an externally created AppSync API, such as one created in the AWS console, you will not be able to manage this API from the Amplify CLI with commands such as amplify api update when performing schema updates.
cli/codegen.md
Outdated
| The `amplify codegen statements [--nodownload]` command generates GraphQL statements(queries, mutation and subscription) based on your GraphQL schema. This command downloads introspection schema everytime it is run but it can be forced to use previously downloaded introspection schema by passing `--nodownload` flag | ||
|
|
||
|
|
||
| ## amplify codegen types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add instructions to how people can put this in their build systems for Xcode, Android Studio, and Webpack (package.json build step)?
undefobj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
mlabieniec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are various places in the doc with typos:
codgen -> codegen
Can you run a spell/grammer check
``` E/flutter (30435): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, String>' E/flutter (30435): #0 new CognitoSignUpOptions (package:amplify_auth_cognito/src/CognitoSignUp/CognitoSignUpOptions.dart:20:87) E/flutter (30435): #1 SignUpState._signUp (package:AwsAmplifySample/components/signUp.dart:29:20) E/flutter (30435): #2 SignUpState.build.<anonymous closure> (package:AwsAmplifySample/components/signUp.dart:190:35) E/flutter (30435): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:993:19) E/flutter (30435): #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1111:38) E/flutter (30435): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:183:24) E/flutter (30435): #6 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:598:11) E/flutter (30435): #7 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:287:5) E/flutter (30435): #8 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:259:7) E/flutter (30435): #9 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:157:27) E/flutter (30435): #10 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:362:20) E/flutter (30435): #11 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:338:22) E/flutter (30435): #12 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:267:11) E/flutter (30435): #13 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:295:7) E/flutter (30435): #14 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:240:7) E/flutter (30435): #15 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:213:7) E/flutter (30435): #16 _rootRunUnary (dart:async/zone.dart:1206:13) E/flutter (30435): #17 _CustomZone.runUnary (dart:async/zone.dart:1100:19) E/flutter (30435): #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7) E/flutter (30435): #19 _invoke1 (dart:ui/hooks.dart:265:10) E/flutter (30435): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5) E/flutter (30435): ``` If `dynamic` is used
No description provided.