How to use the aws-appsync.AUTH_TYPE.AWS_IAM function in aws-appsync

To help you get started, we’ve selected a few aws-appsync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alanbo / serverless-cms / admin / src / hoc / withAuthenticatedAppSync.tsx View on Github external
type: AUTH_TYPE.AWS_IAM,
      credentials: async () => {
        return await Auth.currentCredentials();
      },
    },
    disableOffline: true
  },
  {
    cache,
    link: ApolloLink.from([
      stateLink,
      createAppSyncLink({
        url: aws_vars.graphql_endpoint,
        region: aws_vars.region,
        auth: {
          type: AUTH_TYPE.AWS_IAM,
          credentials: async () => {
            return await Auth.currentCredentials();
          },
        },
        complexObjectsCredentials: () => Auth.currentCredentials()
      })
    ])
  }
);

const ApolloWraper = props => (
  
    
      {props.children}
github alanbo / serverless-cms / admin / src / hoc / withAuthenticatedAppSync.tsx View on Github external
defaults: {
    todos: []
  },
  resolvers: {
  }
});

cache.writeData({ id: 'hey', data: { name: 'alan' } });


const client = new AWSAppSyncClient(
  {
    url: aws_vars.graphql_endpoint,
    region: aws_vars.region,
    auth: {
      type: AUTH_TYPE.AWS_IAM,
      credentials: async () => {
        return await Auth.currentCredentials();
      },
    },
    disableOffline: true
  },
  {
    cache,
    link: ApolloLink.from([
      stateLink,
      createAppSyncLink({
        url: aws_vars.graphql_endpoint,
        region: aws_vars.region,
        auth: {
          type: AUTH_TYPE.AWS_IAM,
          credentials: async () => {