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(Apollo): Add constructor to ApolloAmplifyConnector for directly specifying connection information #2980

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattcreaser
Copy link
Member

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:

Description of changes:
ApolloAmplifyConnector was created to read AppSync connection information from amplify_outputs.json, but some customers who do use Amplify but do not have a Gen2 configuration file (e.g. existing Gen1 customers) may also want to use this class. They already could use the companion functions, but this new constructor makes it possible for them to use the convenience authorizer factories instead.

So now a Gen1 customer can do the following:

val connector = ApolloAmplifyConnector(
    endpointUrl = "https://example1234567890123456789.appsync-api.us-east-1.amazonaws.com/graphql",
    region = "us-east-1",
    apiKey = "[YOUR_API_KEY]"
)

val apolloClient = ApolloClient.Builder()
    .appSync(connector.endpoint, connector.apiKeyAuthorizer())
    .build()

How did you test these changes?
Unit test

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

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

@mattcreaser mattcreaser requested review from a team as code owners January 24, 2025 15:43
Copy link
Member

@tylerjroach tylerjroach left a comment

Choose a reason for hiding this comment

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

BR 1 API Change approved.

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.

2 participants