Skip to content

Instantly share code, notes, and snippets.

@drejohnson
Created May 17, 2018 22:17
Show Gist options
  • Save drejohnson/75a5f3179781641491eb928958c6854c to your computer and use it in GitHub Desktop.
Save drejohnson/75a5f3179781641491eb928958c6854c to your computer and use it in GitHub Desktop.
Reason bindings for AWS AppSync
[@bs.module "aws-appsync"] [@bs.new]
external makeAWSAppSyncClient :
{
.
"url": Js.Nullable.t(string),
"region": Js.Nullable.t(string),
"auth":
Js.Nullable.t(
{
.
"type": string,
"apiKey": string,
},
),
} =>
'a =
"AWSAppSyncClient";
let createAWSAppSyncClient = (~url=?, ~region=?, ~auth=?, ()) => {
let appSyncClientOptions = {
"url": Js.Nullable.fromOption(url),
"region": Js.Nullable.fromOption(region),
"auth": Js.Nullable.fromOption(auth),
};
makeAWSAppSyncClient(appSyncClientOptions);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment