Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

AppSync config example doesn't match TypeScript defs #23

Open
ffxsam opened this issue Jul 7, 2018 · 1 comment
Open

AppSync config example doesn't match TypeScript defs #23

ffxsam opened this issue Jul 7, 2018 · 1 comment

Comments

@ffxsam
Copy link

ffxsam commented Jul 7, 2018

Someone should probably update the example code for creating a client, so it matches the TypeScript types.

const client = new AWSAppSyncClient(
  {
    url: appSyncConfig.graphqlEndpoint,
    region: appSyncConfig.region,
    auth: {
      type: appSyncConfig.authenticationType,
      apiKey: () => appSyncConfig.apiKey,
    },
  }
);

And in the AWS Console, when you download the AppSync.js file, it should definitely use the auth type enum:

import { AUTH_TYPE } from 'aws-appsync/lib/link/auth-link';

export default {
  graphqlEndpoint: 'https://xx',
  region: 'us-east-1',
  authenticationType: AUTH_TYPE.AWS_IAM,
  apiKey: 'xx',
};
@sammartinez
Copy link

@ffxsam Thanks for the feedback, if you'd like you are welcome to cut us a pull request to look into in order to resolve this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants