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

Allow updating graphql endpoint dynamically #490

Open
2 tasks
VivekNeel opened this issue Aug 11, 2021 · 1 comment
Open
2 tasks

Allow updating graphql endpoint dynamically #490

VivekNeel opened this issue Aug 11, 2021 · 1 comment
Labels
feature-request New feature or request GraphQL

Comments

@VivekNeel
Copy link

Is this related to a new or existing framework?

React, React Native

Is this related to a new or existing API?

GraphQL API

Is this related to another service?

No response

Describe the feature you'd like to request

We are using both graphql & graphcdn endpoints and we have use-case where we want few queries to go via graphcdn and rest of them via normal graphql endpoint.

It would be great if we can update the end-point dynamically before the query runs. This is the configuration we have right now :

import API from '@aws-amplify/api';

const AmplifyWebConfig = {
  Auth: {
    userPoolId: awsExports.UserPoolId,
    userPoolWebClientId: awsExports.UserPoolClientIdWeb,
    identityPoolId: awsExports.IdentityPoolId,
    region: awsExports.Region,
    authenticationFlowType: 'USER_PASSWORD_AUTH',
  },
  aws_appsync_graphqlEndpoint: awsExports['API-Endpoint'],
  aws_appsync_region: awsExports.Region,
  aws_appsync_authenticationType: 'AWS_IAM',
  graphql_headers: graphqlHeader,
};
API.configure(AmplifyWebConfig);

I'm trying to update aws_appsync_graphqlEndpoint on the fly. Currently am re-configuring aws with the graphcdn endpoint for the queries i want to get cached which does not sounds like a feasible solution.

Describe the solution you'd like

Give ability to update aws_appsync_graphqlEndpoint on the fly. Something like API.updateEndPoint()

Describe alternatives you've considered

Currently am re-configuring aws with the graphcdn endpoint for the queries i want to get cached which does not sounds like a feasible solution.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@VivekNeel VivekNeel added the feature-request New feature or request label Aug 11, 2021
@lon9man
Copy link

lon9man commented Oct 19, 2021

@VivekNeel am i correctly understand that amplify can't work with multiple GraphQL-endpoints (including non-AWS)?
i see method endpoint in amplify API, but don't see examples used it. maybe it used for non-GraphQL APIs
image

questions:

  1. maybe you have some deeper info about the case?
  2. did you resolve own problem?

@stocaaro stocaaro transferred this issue from aws-amplify/amplify-js Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request GraphQL
Projects
None yet
Development

No branches or pull requests

3 participants