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

feat(data): appsync apollo extensions #7930

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

feat(data): appsync apollo extensions #7930

wants to merge 17 commits into from

Conversation

lawmicha
Copy link
Member

@lawmicha lawmicha commented Aug 29, 2024

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.


### Downloading the AWS AppSync schema

The schema is used by Apollo’s code generation tool to generate API code that helps you execute GraphQL operations. To retrieve your AWS AppSync schema:
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should include a programmatic example (despite not having a command to do this in the backend cli). In development these schema's will change quite often and downloading each time is cumbersome

Copy link
Member Author

Choose a reason for hiding this comment

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

i think the base example should exist, as a way to show a simple way to get the schema from the console, while your suggestion to extend the example makes sense. The ideal example should utilize Apollo's codegen configuration to provide it the introspection endpoint and let Apollo retrieve it as part of the codegen process.

Other programmatic examples would involve taking on a dependency on AWS SDK, like for Javascript and writing a script to download the schema using the appsync client

Copy link
Member Author

Choose a reason for hiding this comment

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

I added an example for swift for fetching the introspection schema programmatically using apollo-ios-cli

@lawmicha lawmicha marked this pull request as ready for review September 4, 2024 17:54
@lawmicha lawmicha requested a review from a team as a code owner September 4, 2024 17:54

Once you have deployed your backend and created the `amplify_outputs.json` file, you can use Amplify library to read and retrieve your configuration values with the following steps:

<InlineFilter filters={["swift"]}>
Copy link
Member

Choose a reason for hiding this comment

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

Need Android version of this section

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the Android section, which is

  1. the gradle for the second package, could you update to the final name?
  2. a code example , need to add this

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated dependency name

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated code snippet

@lawmicha lawmicha enabled auto-merge (squash) September 6, 2024 18:29
josefaidt
josefaidt previously approved these changes Sep 9, 2024
josefaidt
josefaidt previously approved these changes Sep 9, 2024
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.

3 participants