Skip to content
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

add --statement-max-depth flag to optional parameters #7641

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

chrisbonifacio
Copy link
Member

Description of changes:

Related GitHub issue #, if available:

Instructions

If this PR should not be merged upon approval for any reason, please submit as a DRAFT

Which product(s) are affected by this PR (if applicable)?

  • amplify-cli
  • amplify-ui
  • amplify-studio
  • amplify-hosting
  • amplify-libraries

Which platform(s) are affected by this PR (if applicable)?

  • JS
  • Swift
  • Android
  • Flutter
  • React Native

Please add the product(s)/platform(s) affected to the PR title

Checks

  • Does this PR conform to the styleguide?

  • Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.

  • Are any files being deleted with this PR? If so, have the needed redirects been created?

  • Are all links in MDX files using the MDX link syntax rather than HTML link syntax?

    ref: MDX: [link](https://docs.amplify.aws/)
    HTML: <a href="https://docs.amplify.aws/">link</a>

When this PR is ready to merge, please check the box below

  • Ready to merge

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@chrisbonifacio chrisbonifacio requested a review from josefaidt as a code owner May 21, 2024 18:39
@chrisbonifacio chrisbonifacio enabled auto-merge (squash) May 21, 2024 18:39
Jay2113
Jay2113 previously approved these changes May 21, 2024
@@ -252,6 +252,7 @@ Optional parameters:
- `--format`(_string_) (choices: `modelgen`, `graphql-codegen`, `introspection`) - Specifies the format of the GraphQL client code to be generated.
- `--model-target` (_string_) (choices: `java`, `swift`, `javascript`, `typescript`, `dart`) - Specifies the modelgen export target. Only applies when the --format parameter is set to modelgen.
- `--statement-target`(_string_) (choices: `javascript`, `graphql`, `flow`, `typescript`, `angular`) - Specifies the graphql-codegen statement export target. Only applies when the --format parameter is set to graphql-codegen.
- `--statement-max-depth`(_integer_) - Specifies the maximum depth of the generated GraphQL statements. Only applies when the --format parameter is set to graphql-codegen.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a valid CLI option? I'm not seeing it in the help, but if it is we should get it added to the help

ampx generate graphql-client-code

Generates graphql API code

Stack identifier
  --stack  A stack name that contains an Amplify backend                [string]

Project identifier
  --app-id  The Amplify App ID of the project                           [string]
  --branch  A git branch of the Amplify project                         [string]

Options:
  --debug             Print debug logs to the console [boolean] [default: false]
  --help              Show help                                        [boolean]
  --profile           An AWS profile name.                              [string]
  --out               A path to directory where config is written. If not provid
                      ed defaults to current process working directory. [string]
  --format            The format that the GraphQL client code should be generate
                      d in.
              [string] [choices: "modelgen", "graphql-codegen", "introspection"]
  --model-target      The modelgen export target. Only applies when the `--forma
                      t` parameter is set to `modelgen`
         [string] [choices: "java", "swift", "javascript", "typescript", "dart"]
  --statement-target  The graphql-codegen statement export target. Only applies
                      when the `--format` parameter is set to `graphql-codegen`
    [string] [choices: "javascript", "graphql", "flow", "typescript", "angular"]
  --type-target       The optional graphql-codegen type export target. Only appl
                      ies when the `--format` parameter is set to `graphql-codeg
                      en`
  [string] [choices: "json", "swift", "typescript", "flow", "scala", "flow-moder
                                                                  n", "angular"]
  --all               Show hidden options                              [boolean]

Copy link
Member Author

@chrisbonifacio chrisbonifacio May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is and we should!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you mind filing a quick bug report for this in the backend repo? are there any other options we should add?

(in the future I'd like to generate this page from the CLI itself)

Copy link
Member Author

@chrisbonifacio chrisbonifacio May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! aws-amplify/amplify-backend#1546

Not aware of other missing options, scanned through the amplify-backend codebase and found where the commands are listed. Some are missing but are explicitly set to be hidden.

https://github.com/aws-amplify/amplify-backend/blob/4e7d59fb8226830e0c58dc48b2efd28d56254470/packages/cli/src/commands/generate/graphql-client-code/generate_graphql_client_code_command.ts#L207

josefaidt
josefaidt previously approved these changes Nov 6, 2024
@chrisbonifacio chrisbonifacio dismissed stale reviews from josefaidt and Jay2113 via 858b80f November 6, 2024 19:30
@chrisbonifacio chrisbonifacio merged commit 7eed946 into main Nov 7, 2024
12 checks passed
@chrisbonifacio chrisbonifacio deleted the cbonif/add-max-depth-flag branch November 7, 2024 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants