We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.AppSync

Inherits:
AWS.Service show all
Identifier:
appsync
API Version:
2017-07-25
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

AppSync provides API actions for creating and interacting with data sources using GraphQL from your application.

Sending a Request Using AppSync

var appsync = new AWS.AppSync();
appsync.associateApi(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the AppSync object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var appsync = new AWS.AppSync({apiVersion: '2017-07-25'});

You can also set the API version globally in AWS.config.apiVersions using the appsync service identifier:

AWS.config.apiVersions = {
  appsync: '2017-07-25',
  // other service API versions
};

var appsync = new AWS.AppSync();

Version:

  • 2017-07-25

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.AppSync(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a AppSync object

var appsync = new AWS.AppSync({apiVersion: '2017-07-25'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.AppSync.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.AppSync.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.AppSync.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

associateApi(params = {}, callback) ⇒ AWS.Request

Maps an endpoint to your custom domain.

Service Reference:

Examples:

Calling the associateApi operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  domainName: 'STRING_VALUE' /* required */
};
appsync.associateApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • domainName — (String)

      The domain name.

    • apiId — (String)

      The API ID. Private APIs can not be associated with custom domains.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiAssociation — (map)

        The ApiAssociation object.

        • domainName — (String)

          The domain name.

        • apiId — (String)

          The API ID.

        • associationStatus — (String)

          Identifies the status of an association.

          • PROCESSING: The API association is being created. You cannot modify association requests during processing.

          • SUCCESS: The API association was successful. You can modify associations after success.

          • FAILED: The API association has failed. You can modify associations after failure.

          Possible values include:
          • "PROCESSING"
          • "FAILED"
          • "SUCCESS"
        • deploymentDetail — (String)

          Details about the last deployment status.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateMergedGraphqlApi(params = {}, callback) ⇒ AWS.Request

Creates an association between a Merged API and source API using the source API's identifier.

Service Reference:

Examples:

Calling the associateMergedGraphqlApi operation

var params = {
  mergedApiIdentifier: 'STRING_VALUE', /* required */
  sourceApiIdentifier: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  sourceApiAssociationConfig: {
    mergeType: MANUAL_MERGE | AUTO_MERGE
  }
};
appsync.associateMergedGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • sourceApiIdentifier — (String)

      The identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API.

    • mergedApiIdentifier — (String)

      The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.

    • description — (String)

      The description field.

    • sourceApiAssociationConfig — (map)

      The SourceApiAssociationConfig object data.

      • mergeType — (String)

        The property that indicates which merging option is enabled in the source API association.

        Valid merge types are MANUAL_MERGE (default) and AUTO_MERGE. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use MergedApiExecutionRoleArn to perform merge operations.

        Possible values include:
        • "MANUAL_MERGE"
        • "AUTO_MERGE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociation — (map)

        The SourceApiAssociation object data.

        • associationId — (String)

          The ID generated by the AppSync service for the source API association.

        • associationArn — (String)

          The Amazon Resource Name (ARN) of the source API association.

        • sourceApiId — (String)

          The ID of the AppSync source API.

        • sourceApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync source API.

        • mergedApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync Merged API.

        • mergedApiId — (String)

          The ID of the AppSync Merged API.

        • description — (String)

          The description field.

        • sourceApiAssociationConfig — (map)

          The SourceApiAssociationConfig object data.

          • mergeType — (String)

            The property that indicates which merging option is enabled in the source API association.

            Valid merge types are MANUAL_MERGE (default) and AUTO_MERGE. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use MergedApiExecutionRoleArn to perform merge operations.

            Possible values include:
            • "MANUAL_MERGE"
            • "AUTO_MERGE"
        • sourceApiAssociationStatus — (String)

          The state of the source API association.

          Possible values include:
          • "MERGE_SCHEDULED"
          • "MERGE_FAILED"
          • "MERGE_SUCCESS"
          • "MERGE_IN_PROGRESS"
          • "AUTO_MERGE_SCHEDULE_FAILED"
          • "DELETION_SCHEDULED"
          • "DELETION_IN_PROGRESS"
          • "DELETION_FAILED"
        • sourceApiAssociationStatusDetail — (String)

          The detailed message related to the current state of the source API association.

        • lastSuccessfulMergeDate — (Date)

          The datetime value of the last successful merge of the source API association. The result will be in UTC format and your local time zone.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

associateSourceGraphqlApi(params = {}, callback) ⇒ AWS.Request

Creates an association between a Merged API and source API using the Merged API's identifier.

Service Reference:

Examples:

Calling the associateSourceGraphqlApi operation

var params = {
  mergedApiIdentifier: 'STRING_VALUE', /* required */
  sourceApiIdentifier: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  sourceApiAssociationConfig: {
    mergeType: MANUAL_MERGE | AUTO_MERGE
  }
};
appsync.associateSourceGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • mergedApiIdentifier — (String)

      The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.

    • sourceApiIdentifier — (String)

      The identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API.

    • description — (String)

      The description field.

    • sourceApiAssociationConfig — (map)

      The SourceApiAssociationConfig object data.

      • mergeType — (String)

        The property that indicates which merging option is enabled in the source API association.

        Valid merge types are MANUAL_MERGE (default) and AUTO_MERGE. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use MergedApiExecutionRoleArn to perform merge operations.

        Possible values include:
        • "MANUAL_MERGE"
        • "AUTO_MERGE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociation — (map)

        The SourceApiAssociation object data.

        • associationId — (String)

          The ID generated by the AppSync service for the source API association.

        • associationArn — (String)

          The Amazon Resource Name (ARN) of the source API association.

        • sourceApiId — (String)

          The ID of the AppSync source API.

        • sourceApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync source API.

        • mergedApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync Merged API.

        • mergedApiId — (String)

          The ID of the AppSync Merged API.

        • description — (String)

          The description field.

        • sourceApiAssociationConfig — (map)

          The SourceApiAssociationConfig object data.

          • mergeType — (String)

            The property that indicates which merging option is enabled in the source API association.

            Valid merge types are MANUAL_MERGE (default) and AUTO_MERGE. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use MergedApiExecutionRoleArn to perform merge operations.

            Possible values include:
            • "MANUAL_MERGE"
            • "AUTO_MERGE"
        • sourceApiAssociationStatus — (String)

          The state of the source API association.

          Possible values include:
          • "MERGE_SCHEDULED"
          • "MERGE_FAILED"
          • "MERGE_SUCCESS"
          • "MERGE_IN_PROGRESS"
          • "AUTO_MERGE_SCHEDULE_FAILED"
          • "DELETION_SCHEDULED"
          • "DELETION_IN_PROGRESS"
          • "DELETION_FAILED"
        • sourceApiAssociationStatusDetail — (String)

          The detailed message related to the current state of the source API association.

        • lastSuccessfulMergeDate — (Date)

          The datetime value of the last successful merge of the source API association. The result will be in UTC format and your local time zone.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createApiCache(params = {}, callback) ⇒ AWS.Request

Creates a cache for the GraphQL API.

Service Reference:

Examples:

Calling the createApiCache operation

var params = {
  apiCachingBehavior: FULL_REQUEST_CACHING | PER_RESOLVER_CACHING, /* required */
  apiId: 'STRING_VALUE', /* required */
  ttl: 'NUMBER_VALUE', /* required */
  type: T2_SMALL | T2_MEDIUM | R4_LARGE | R4_XLARGE | R4_2XLARGE | R4_4XLARGE | R4_8XLARGE | SMALL | MEDIUM | LARGE | XLARGE | LARGE_2X | LARGE_4X | LARGE_8X | LARGE_12X, /* required */
  atRestEncryptionEnabled: true || false,
  healthMetricsConfig: ENABLED | DISABLED,
  transitEncryptionEnabled: true || false
};
appsync.createApiCache(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The GraphQL API ID.

    • ttl — (Integer)

      TTL in seconds for cache entries.

      Valid values are 1–3,600 seconds.

    • transitEncryptionEnabled — (Boolean)

      Transit encryption flag when connecting to cache. You cannot update this setting after creation.

    • atRestEncryptionEnabled — (Boolean)

      At-rest encryption flag for cache. You cannot update this setting after creation.

    • apiCachingBehavior — (String)

      Caching behavior.

      • FULL_REQUEST_CACHING: All requests are fully cached.

      • PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.

      Possible values include:
      • "FULL_REQUEST_CACHING"
      • "PER_RESOLVER_CACHING"
    • type — (String)

      The cache instance type. Valid values are

      • SMALL

      • MEDIUM

      • LARGE

      • XLARGE

      • LARGE_2X

      • LARGE_4X

      • LARGE_8X (not available in all regions)

      • LARGE_12X

      Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.

      The following legacy instance types are available, but their use is discouraged:

      • T2_SMALL: A t2.small instance type.

      • T2_MEDIUM: A t2.medium instance type.

      • R4_LARGE: A r4.large instance type.

      • R4_XLARGE: A r4.xlarge instance type.

      • R4_2XLARGE: A r4.2xlarge instance type.

      • R4_4XLARGE: A r4.4xlarge instance type.

      • R4_8XLARGE: A r4.8xlarge instance type.

      Possible values include:
      • "T2_SMALL"
      • "T2_MEDIUM"
      • "R4_LARGE"
      • "R4_XLARGE"
      • "R4_2XLARGE"
      • "R4_4XLARGE"
      • "R4_8XLARGE"
      • "SMALL"
      • "MEDIUM"
      • "LARGE"
      • "XLARGE"
      • "LARGE_2X"
      • "LARGE_4X"
      • "LARGE_8X"
      • "LARGE_12X"
    • healthMetricsConfig — (String)

      Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:

      • NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.

      • EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.

      Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiCache — (map)

        The ApiCache object.

        • ttl — (Integer)

          TTL in seconds for cache entries.

          Valid values are 1–3,600 seconds.

        • apiCachingBehavior — (String)

          Caching behavior.

          • FULL_REQUEST_CACHING: All requests are fully cached.

          • PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.

          Possible values include:
          • "FULL_REQUEST_CACHING"
          • "PER_RESOLVER_CACHING"
        • transitEncryptionEnabled — (Boolean)

          Transit encryption flag when connecting to cache. You cannot update this setting after creation.

        • atRestEncryptionEnabled — (Boolean)

          At-rest encryption flag for cache. You cannot update this setting after creation.

        • type — (String)

          The cache instance type. Valid values are

          • SMALL

          • MEDIUM

          • LARGE

          • XLARGE

          • LARGE_2X

          • LARGE_4X

          • LARGE_8X (not available in all regions)

          • LARGE_12X

          Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.

          The following legacy instance types are available, but their use is discouraged:

          • T2_SMALL: A t2.small instance type.

          • T2_MEDIUM: A t2.medium instance type.

          • R4_LARGE: A r4.large instance type.

          • R4_XLARGE: A r4.xlarge instance type.

          • R4_2XLARGE: A r4.2xlarge instance type.

          • R4_4XLARGE: A r4.4xlarge instance type.

          • R4_8XLARGE: A r4.8xlarge instance type.

          Possible values include:
          • "T2_SMALL"
          • "T2_MEDIUM"
          • "R4_LARGE"
          • "R4_XLARGE"
          • "R4_2XLARGE"
          • "R4_4XLARGE"
          • "R4_8XLARGE"
          • "SMALL"
          • "MEDIUM"
          • "LARGE"
          • "XLARGE"
          • "LARGE_2X"
          • "LARGE_4X"
          • "LARGE_8X"
          • "LARGE_12X"
        • status — (String)

          The cache instance status.

          • AVAILABLE: The instance is available for use.

          • CREATING: The instance is currently creating.

          • DELETING: The instance is currently deleting.

          • MODIFYING: The instance is currently modifying.

          • FAILED: The instance has failed creation.

          Possible values include:
          • "AVAILABLE"
          • "CREATING"
          • "DELETING"
          • "MODIFYING"
          • "FAILED"
        • healthMetricsConfig — (String)

          Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:

          • NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.

          • EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.

          Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createApiKey(params = {}, callback) ⇒ AWS.Request

Creates a unique key that you can distribute to clients who invoke your API.

Service Reference:

Examples:

Calling the createApiKey operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  expires: 'NUMBER_VALUE'
};
appsync.createApiKey(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The ID for your GraphQL API.

    • description — (String)

      A description of the purpose of the API key.

    • expires — (Integer)

      From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiKey — (map)

        The API key.

        • id — (String)

          The API key ID.

        • description — (String)

          A description of the purpose of the API key.

        • expires — (Integer)

          The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

        • deletes — (Integer)

          The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDataSource(params = {}, callback) ⇒ AWS.Request

Creates a DataSource object.

Service Reference:

Examples:

Calling the createDataSource operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  type: AWS_LAMBDA | AMAZON_DYNAMODB | AMAZON_ELASTICSEARCH | NONE | HTTP | RELATIONAL_DATABASE | AMAZON_OPENSEARCH_SERVICE | AMAZON_EVENTBRIDGE, /* required */
  description: 'STRING_VALUE',
  dynamodbConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    tableName: 'STRING_VALUE', /* required */
    deltaSyncConfig: {
      baseTableTTL: 'NUMBER_VALUE',
      deltaSyncTableName: 'STRING_VALUE',
      deltaSyncTableTTL: 'NUMBER_VALUE'
    },
    useCallerCredentials: true || false,
    versioned: true || false
  },
  elasticsearchConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    endpoint: 'STRING_VALUE' /* required */
  },
  eventBridgeConfig: {
    eventBusArn: 'STRING_VALUE' /* required */
  },
  httpConfig: {
    authorizationConfig: {
      authorizationType: AWS_IAM, /* required */
      awsIamConfig: {
        signingRegion: 'STRING_VALUE',
        signingServiceName: 'STRING_VALUE'
      }
    },
    endpoint: 'STRING_VALUE'
  },
  lambdaConfig: {
    lambdaFunctionArn: 'STRING_VALUE' /* required */
  },
  metricsConfig: ENABLED | DISABLED,
  openSearchServiceConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    endpoint: 'STRING_VALUE' /* required */
  },
  relationalDatabaseConfig: {
    rdsHttpEndpointConfig: {
      awsRegion: 'STRING_VALUE',
      awsSecretStoreArn: 'STRING_VALUE',
      databaseName: 'STRING_VALUE',
      dbClusterIdentifier: 'STRING_VALUE',
      schema: 'STRING_VALUE'
    },
    relationalDatabaseSourceType: RDS_HTTP_ENDPOINT
  },
  serviceRoleArn: 'STRING_VALUE'
};
appsync.createDataSource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID for the GraphQL API for the DataSource.

    • name — (String)

      A user-supplied name for the DataSource.

    • description — (String)

      A description of the DataSource.

    • type — (String)

      The type of the DataSource.

      Possible values include:
      • "AWS_LAMBDA"
      • "AMAZON_DYNAMODB"
      • "AMAZON_ELASTICSEARCH"
      • "NONE"
      • "HTTP"
      • "RELATIONAL_DATABASE"
      • "AMAZON_OPENSEARCH_SERVICE"
      • "AMAZON_EVENTBRIDGE"
    • serviceRoleArn — (String)

      The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.

    • dynamodbConfig — (map)

      Amazon DynamoDB settings.

      • tableNamerequired — (String)

        The table name.

      • awsRegionrequired — (String)

        The Amazon Web Services Region.

      • useCallerCredentials — (Boolean)

        Set to TRUE to use Amazon Cognito credentials with this data source.

      • deltaSyncConfig — (map)

        The DeltaSyncConfig for a versioned data source.

        • baseTableTTL — (Integer)

          The number of minutes that an Item is stored in the data source.

        • deltaSyncTableName — (String)

          The Delta Sync table name.

        • deltaSyncTableTTL — (Integer)

          The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.

      • versioned — (Boolean)

        Set to TRUE to use Conflict Detection and Resolution with this data source.

    • lambdaConfig — (map)

      Lambda settings.

      • lambdaFunctionArnrequired — (String)

        The Amazon Resource Name (ARN) for the Lambda function.

    • elasticsearchConfig — (map)

      Amazon OpenSearch Service settings.

      As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create an OpenSearch data source.

      • endpointrequired — (String)

        The endpoint.

      • awsRegionrequired — (String)

        The Amazon Web Services Region.

    • openSearchServiceConfig — (map)

      Amazon OpenSearch Service settings.

      • endpointrequired — (String)

        The endpoint.

      • awsRegionrequired — (String)

        The Amazon Web Services Region.

    • httpConfig — (map)

      HTTP endpoint settings.

      • endpoint — (String)

        The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

      • authorizationConfig — (map)

        The authorization configuration in case the HTTP endpoint requires authorization.

        • authorizationTyperequired — (String)

          The authorization type that the HTTP endpoint requires.

          • AWS_IAM: The authorization type is Signature Version 4 (SigV4).

          Possible values include:
          • "AWS_IAM"
        • awsIamConfig — (map)

          The Identity and Access Management (IAM) settings.

          • signingRegion — (String)

            The signing Amazon Web Services Region for IAM authorization.

          • signingServiceName — (String)

            The signing service name for IAM authorization.

    • relationalDatabaseConfig — (map)

      Relational database settings.

      • relationalDatabaseSourceType — (String)

        Source type for the relational database.

        • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.

        Possible values include:
        • "RDS_HTTP_ENDPOINT"
      • rdsHttpEndpointConfig — (map)

        Amazon RDS HTTP endpoint settings.

        • awsRegion — (String)

          Amazon Web Services Region for Amazon RDS HTTP endpoint.

        • dbClusterIdentifier — (String)

          Amazon RDS cluster Amazon Resource Name (ARN).

        • databaseName — (String)

          Logical database name.

        • schema — (String)

          Logical schema name.

        • awsSecretStoreArn — (String)

          Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.

    • eventBridgeConfig — (map)

      Amazon EventBridge settings.

    • metricsConfig — (String)

      Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

      metricsConfig can be ENABLED or DISABLED.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • dataSource — (map)

        The DataSource object.

        • dataSourceArn — (String)

          The data source Amazon Resource Name (ARN).

        • name — (String)

          The name of the data source.

        • description — (String)

          The description of the data source.

        • type — (String)

          The type of the data source.

          • AWS_LAMBDA: The data source is an Lambda function.

          • AMAZON_DYNAMODB: The data source is an Amazon DynamoDB table.

          • AMAZON_ELASTICSEARCH: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_OPENSEARCH_SERVICE: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_EVENTBRIDGE: The data source is an Amazon EventBridge configuration.

          • NONE: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.

          • HTTP: The data source is an HTTP endpoint.

          • RELATIONAL_DATABASE: The data source is a relational database.

          Possible values include:
          • "AWS_LAMBDA"
          • "AMAZON_DYNAMODB"
          • "AMAZON_ELASTICSEARCH"
          • "NONE"
          • "HTTP"
          • "RELATIONAL_DATABASE"
          • "AMAZON_OPENSEARCH_SERVICE"
          • "AMAZON_EVENTBRIDGE"
        • serviceRoleArn — (String)

          The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.

        • dynamodbConfig — (map)

          DynamoDB settings.

          • tableNamerequired — (String)

            The table name.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

          • useCallerCredentials — (Boolean)

            Set to TRUE to use Amazon Cognito credentials with this data source.

          • deltaSyncConfig — (map)

            The DeltaSyncConfig for a versioned data source.

            • baseTableTTL — (Integer)

              The number of minutes that an Item is stored in the data source.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.

          • versioned — (Boolean)

            Set to TRUE to use Conflict Detection and Resolution with this data source.

        • lambdaConfig — (map)

          Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The Amazon Resource Name (ARN) for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • openSearchServiceConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • httpConfig — (map)

          HTTP endpoint settings.

          • endpoint — (String)

            The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization configuration in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type that the HTTP endpoint requires.

              • AWS_IAM: The authorization type is Signature Version 4 (SigV4).

              Possible values include:
              • "AWS_IAM"
            • awsIamConfig — (map)

              The Identity and Access Management (IAM) settings.

              • signingRegion — (String)

                The signing Amazon Web Services Region for IAM authorization.

              • signingServiceName — (String)

                The signing service name for IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.

            Possible values include:
            • "RDS_HTTP_ENDPOINT"
          • rdsHttpEndpointConfig — (map)

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for Amazon RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster Amazon Resource Name (ARN).

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.

        • eventBridgeConfig — (map)

          Amazon EventBridge settings.

        • metricsConfig — (String)

          Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDomainName(params = {}, callback) ⇒ AWS.Request

Creates a custom DomainName object.

Service Reference:

Examples:

Calling the createDomainName operation

var params = {
  certificateArn: 'STRING_VALUE', /* required */
  domainName: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE'
};
appsync.createDomainName(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • domainName — (String)

      The domain name.

    • certificateArn — (String)

      The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.

    • description — (String)

      A description of the DomainName.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • domainNameConfig — (map)

        The configuration for the DomainName.

        • domainName — (String)

          The domain name.

        • description — (String)

          A description of the DomainName configuration.

        • certificateArn — (String)

          The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.

        • appsyncDomainName — (String)

          The domain name that AppSync provides.

        • hostedZoneId — (String)

          The ID of your Amazon Route 53 hosted zone.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createFunction(params = {}, callback) ⇒ AWS.Request

Creates a Function object.

A function is a reusable entity. You can use multiple functions to compose the resolver logic.

Service Reference:

Examples:

Calling the createFunction operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  dataSourceName: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  code: 'STRING_VALUE',
  description: 'STRING_VALUE',
  functionVersion: 'STRING_VALUE',
  maxBatchSize: 'NUMBER_VALUE',
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  runtime: {
    name: APPSYNC_JS, /* required */
    runtimeVersion: 'STRING_VALUE' /* required */
  },
  syncConfig: {
    conflictDetection: VERSION | NONE,
    conflictHandler: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE,
    lambdaConflictHandlerConfig: {
      lambdaConflictHandlerArn: 'STRING_VALUE'
    }
  }
};
appsync.createFunction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The GraphQL API ID.

    • name — (String)

      The Function name. The function name does not have to be unique.

    • description — (String)

      The Function description.

    • dataSourceName — (String)

      The Function DataSource name.

    • requestMappingTemplate — (String)

      The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

    • responseMappingTemplate — (String)

      The Function response mapping template.

    • functionVersion — (String)

      The version of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the functionVersion is required.

    • syncConfig — (map)

      Describes a Sync configuration for a resolver.

      Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

      • conflictHandler — (String)

        The Conflict Resolution strategy to perform in the event of a conflict.

        • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

        • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

        • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

        Possible values include:
        • "OPTIMISTIC_CONCURRENCY"
        • "LAMBDA"
        • "AUTOMERGE"
        • "NONE"
      • conflictDetection — (String)

        The Conflict Detection strategy to use.

        • VERSION: Detect conflicts based on object versions for this resolver.

        • NONE: Do not detect conflicts when invoking this resolver.

        Possible values include:
        • "VERSION"
        • "NONE"
      • lambdaConflictHandlerConfig — (map)

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

    • maxBatchSize — (Integer)

      The maximum batching size for a resolver.

    • runtime — (map)

      Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

      • namerequired — (String)

        The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

        Possible values include:
        • "APPSYNC_JS"
      • runtimeVersionrequired — (String)

        The version of the runtime to use. Currently, the only allowed version is 1.0.0.

    • code — (String)

      The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • functionConfiguration — (map)

        The Function object.

        • functionId — (String)

          A unique ID representing the Function object.

        • functionArn — (String)

          The Amazon Resource Name (ARN) of the Function object.

        • name — (String)

          The name of the Function object.

        • description — (String)

          The Function description.

        • dataSourceName — (String)

          The name of the DataSource.

        • requestMappingTemplate — (String)

          The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

        • responseMappingTemplate — (String)

          The Function response mapping template.

        • functionVersion — (String)

          The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.

        • syncConfig — (map)

          Describes a Sync configuration for a resolver.

          Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createGraphqlApi(params = {}, callback) ⇒ AWS.Request

Creates a GraphqlApi object.

Service Reference:

Examples:

Calling the createGraphqlApi operation

var params = {
  authenticationType: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT | AWS_LAMBDA, /* required */
  name: 'STRING_VALUE', /* required */
  additionalAuthenticationProviders: [
    {
      authenticationType: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT | AWS_LAMBDA,
      lambdaAuthorizerConfig: {
        authorizerUri: 'STRING_VALUE', /* required */
        authorizerResultTtlInSeconds: 'NUMBER_VALUE',
        identityValidationExpression: 'STRING_VALUE'
      },
      openIDConnectConfig: {
        issuer: 'STRING_VALUE', /* required */
        authTTL: 'NUMBER_VALUE',
        clientId: 'STRING_VALUE',
        iatTTL: 'NUMBER_VALUE'
      },
      userPoolConfig: {
        awsRegion: 'STRING_VALUE', /* required */
        userPoolId: 'STRING_VALUE', /* required */
        appIdClientRegex: 'STRING_VALUE'
      }
    },
    /* more items */
  ],
  apiType: GRAPHQL | MERGED,
  enhancedMetricsConfig: {
    dataSourceLevelMetricsBehavior: FULL_REQUEST_DATA_SOURCE_METRICS | PER_DATA_SOURCE_METRICS, /* required */
    operationLevelMetricsConfig: ENABLED | DISABLED, /* required */
    resolverLevelMetricsBehavior: FULL_REQUEST_RESOLVER_METRICS | PER_RESOLVER_METRICS /* required */
  },
  introspectionConfig: ENABLED | DISABLED,
  lambdaAuthorizerConfig: {
    authorizerUri: 'STRING_VALUE', /* required */
    authorizerResultTtlInSeconds: 'NUMBER_VALUE',
    identityValidationExpression: 'STRING_VALUE'
  },
  logConfig: {
    cloudWatchLogsRoleArn: 'STRING_VALUE', /* required */
    fieldLogLevel: NONE | ERROR | ALL | INFO | DEBUG, /* required */
    excludeVerboseContent: true || false
  },
  mergedApiExecutionRoleArn: 'STRING_VALUE',
  openIDConnectConfig: {
    issuer: 'STRING_VALUE', /* required */
    authTTL: 'NUMBER_VALUE',
    clientId: 'STRING_VALUE',
    iatTTL: 'NUMBER_VALUE'
  },
  ownerContact: 'STRING_VALUE',
  queryDepthLimit: 'NUMBER_VALUE',
  resolverCountLimit: 'NUMBER_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  },
  userPoolConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    defaultAction: ALLOW | DENY, /* required */
    userPoolId: 'STRING_VALUE', /* required */
    appIdClientRegex: 'STRING_VALUE'
  },
  visibility: GLOBAL | PRIVATE,
  xrayEnabled: true || false
};
appsync.createGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      A user-supplied name for the GraphqlApi.

    • logConfig — (map)

      The Amazon CloudWatch Logs configuration.

      • fieldLogLevelrequired — (String)

        The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL.

        • NONE: No field-level logs are captured.

        • ERROR: Logs the following information only for the fields that are in the error category:

          • The error section in the server response.

          • Field-level errors.

          • The generated request/response functions that got resolved for error fields.

        • INFO: Logs the following information only for the fields that are in the info and error categories:

          • Info-level messages.

          • The user messages sent through $util.log.info and console.log.

          • Field-level tracing and mapping logs are not shown.

        • DEBUG: Logs the following information only for the fields that are in the debug, info, and error categories:

          • Debug-level messages.

          • The user messages sent through $util.log.info, $util.log.debug, console.log, and console.debug.

          • Field-level tracing and mapping logs are not shown.

        • ALL: The following information is logged for all fields in the query:

          • Field-level tracing information.

          • The generated request/response functions that were resolved for each field.

        Possible values include:
        • "NONE"
        • "ERROR"
        • "ALL"
        • "INFO"
        • "DEBUG"
      • cloudWatchLogsRoleArnrequired — (String)

        The service role that AppSync assumes to publish to CloudWatch logs in your account.

      • excludeVerboseContent — (Boolean)

        Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

    • authenticationType — (String)

      The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.

      Possible values include:
      • "API_KEY"
      • "AWS_IAM"
      • "AMAZON_COGNITO_USER_POOLS"
      • "OPENID_CONNECT"
      • "AWS_LAMBDA"
    • userPoolConfig — (map)

      The Amazon Cognito user pool configuration.

      • userPoolIdrequired — (String)

        The user pool ID.

      • awsRegionrequired — (String)

        The Amazon Web Services Region in which the user pool was created.

      • defaultActionrequired — (String)

        The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.

        Possible values include:
        • "ALLOW"
        • "DENY"
      • appIdClientRegex — (String)

        A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

    • openIDConnectConfig — (map)

      The OIDC configuration.

      • issuerrequired — (String)

        The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

      • clientId — (String)

        The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

      • iatTTL — (Integer)

        The number of milliseconds that a token is valid after it's issued to a user.

      • authTTL — (Integer)

        The number of milliseconds that a token is valid after being authenticated.

    • tags — (map<String>)

      A TagMap object.

    • additionalAuthenticationProviders — (Array<map>)

      A list of additional authentication providers for the GraphqlApi API.

      • authenticationType — (String)

        The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.

        Possible values include:
        • "API_KEY"
        • "AWS_IAM"
        • "AMAZON_COGNITO_USER_POOLS"
        • "OPENID_CONNECT"
        • "AWS_LAMBDA"
      • openIDConnectConfig — (map)

        The OIDC configuration.

        • issuerrequired — (String)

          The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

        • clientId — (String)

          The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

        • iatTTL — (Integer)

          The number of milliseconds that a token is valid after it's issued to a user.

        • authTTL — (Integer)

          The number of milliseconds that a token is valid after being authenticated.

      • userPoolConfig — (map)

        The Amazon Cognito user pool configuration.

        • userPoolIdrequired — (String)

          The user pool ID.

        • awsRegionrequired — (String)

          The Amazon Web Services Region in which the user pool was created.

        • appIdClientRegex — (String)

          A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

      • lambdaAuthorizerConfig — (map)

        Configuration for Lambda function authorization.

        • authorizerResultTtlInSeconds — (Integer)

          The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

        • authorizerUrirequired — (String)

          The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

          Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

          aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

        • identityValidationExpression — (String)

          A regular expression for validation of tokens before the Lambda function is called.

    • xrayEnabled — (Boolean)

      A flag indicating whether to use X-Ray tracing for the GraphqlApi.

    • lambdaAuthorizerConfig — (map)

      Configuration for Lambda function authorization.

      • authorizerResultTtlInSeconds — (Integer)

        The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

      • authorizerUrirequired — (String)

        The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

        Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

        aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

      • identityValidationExpression — (String)

        A regular expression for validation of tokens before the Lambda function is called.

    • visibility — (String)

      Sets the value of the GraphQL API to public (GLOBAL) or private (PRIVATE). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.

      Possible values include:
      • "GLOBAL"
      • "PRIVATE"
    • apiType — (String)

      The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED).

      Possible values include:
      • "GRAPHQL"
      • "MERGED"
    • mergedApiExecutionRoleArn — (String)

      The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.

    • ownerContact — (String)

      The owner contact information for an API resource.

      This field accepts any string input with a length of 0 - 256 characters.

    • introspectionConfig — (String)

      Sets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.

      For more information about introspection, see GraphQL introspection.

      Possible values include:
      • "ENABLED"
      • "DISABLED"
    • queryDepthLimit — (Integer)

      The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.

      Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.

    • resolverCountLimit — (Integer)

      The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000. When specified, the limit value can be between 1 and 10000. This field will produce a limit error if the operation falls out of bounds.

    • enhancedMetricsConfig — (map)

      The enhancedMetricsConfig object.

      • resolverLevelMetricsBehaviorrequired — (String)

        Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

        • GraphQL errors: The number of GraphQL errors that occurred.

        • Requests: The number of invocations that occurred during a request.

        • Latency: The time to complete a resolver invocation.

        • Cache hits: The number of cache hits during a request.

        • Cache misses: The number of cache misses during a request.

        These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

        • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

        • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

        Possible values include:
        • "FULL_REQUEST_RESOLVER_METRICS"
        • "PER_RESOLVER_METRICS"
      • dataSourceLevelMetricsBehaviorrequired — (String)

        Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

        • Requests: The number of invocations that occured during a request.

        • Latency: The time to complete a data source invocation.

        • Errors: The number of errors that occurred during a data source invocation.

        These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

        • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

        • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

        Possible values include:
        • "FULL_REQUEST_DATA_SOURCE_METRICS"
        • "PER_DATA_SOURCE_METRICS"
      • operationLevelMetricsConfigrequired — (String)

        Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

        • Requests: The number of times a specified GraphQL operation was called.

        • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

        Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

        Possible values include:
        • "ENABLED"
        • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • graphqlApi — (map)

        The GraphqlApi.

        • name — (String)

          The API name.

        • apiId — (String)

          The API ID.

        • authenticationType — (String)

          The authentication type.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
          • "AWS_LAMBDA"
        • logConfig — (map)

          The Amazon CloudWatch Logs configuration.

          • fieldLogLevelrequired — (String)

            The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL.

            • NONE: No field-level logs are captured.

            • ERROR: Logs the following information only for the fields that are in the error category:

              • The error section in the server response.

              • Field-level errors.

              • The generated request/response functions that got resolved for error fields.

            • INFO: Logs the following information only for the fields that are in the info and error categories:

              • Info-level messages.

              • The user messages sent through $util.log.info and console.log.

              • Field-level tracing and mapping logs are not shown.

            • DEBUG: Logs the following information only for the fields that are in the debug, info, and error categories:

              • Debug-level messages.

              • The user messages sent through $util.log.info, $util.log.debug, console.log, and console.debug.

              • Field-level tracing and mapping logs are not shown.

            • ALL: The following information is logged for all fields in the query:

              • Field-level tracing information.

              • The generated request/response functions that were resolved for each field.

            Possible values include:
            • "NONE"
            • "ERROR"
            • "ALL"
            • "INFO"
            • "DEBUG"
          • cloudWatchLogsRoleArnrequired — (String)

            The service role that AppSync assumes to publish to CloudWatch logs in your account.

          • excludeVerboseContent — (Boolean)

            Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

        • userPoolConfig — (map)

          The Amazon Cognito user pool configuration.

          • userPoolIdrequired — (String)

            The user pool ID.

          • awsRegionrequired — (String)

            The Amazon Web Services Region in which the user pool was created.

          • defaultActionrequired — (String)

            The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.

            Possible values include:
            • "ALLOW"
            • "DENY"
          • appIdClientRegex — (String)

            A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

          • clientId — (String)

            The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds that a token is valid after it's issued to a user.

          • authTTL — (Integer)

            The number of milliseconds that a token is valid after being authenticated.

        • arn — (String)

          The Amazon Resource Name (ARN).

        • uris — (map<String>)

          The URIs.

        • tags — (map<String>)

          The tags.

        • additionalAuthenticationProviders — (Array<map>)

          A list of additional authentication providers for the GraphqlApi API.

          • authenticationType — (String)

            The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
            • "AWS_LAMBDA"
          • openIDConnectConfig — (map)

            The OIDC configuration.

            • issuerrequired — (String)

              The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

            • clientId — (String)

              The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds that a token is valid after it's issued to a user.

            • authTTL — (Integer)

              The number of milliseconds that a token is valid after being authenticated.

          • userPoolConfig — (map)

            The Amazon Cognito user pool configuration.

            • userPoolIdrequired — (String)

              The user pool ID.

            • awsRegionrequired — (String)

              The Amazon Web Services Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

          • lambdaAuthorizerConfig — (map)

            Configuration for Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

            • authorizerUrirequired — (String)

              The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

              Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

              aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

            • identityValidationExpression — (String)

              A regular expression for validation of tokens before the Lambda function is called.

        • xrayEnabled — (Boolean)

          A flag indicating whether to use X-Ray tracing for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

          • authorizerUrirequired — (String)

            The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

            Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

            aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

          • identityValidationExpression — (String)

            A regular expression for validation of tokens before the Lambda function is called.

        • dns — (map<String>)

          The DNS records for the API.

        • visibility — (String)

          Sets the value of the GraphQL API to public (GLOBAL) or private (PRIVATE). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.

          Possible values include:
          • "GLOBAL"
          • "PRIVATE"
        • apiType — (String)

          The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED).

          Possible values include:
          • "GRAPHQL"
          • "MERGED"
        • mergedApiExecutionRoleArn — (String)

          The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.

        • owner — (String)

          The account owner of the GraphQL API.

        • ownerContact — (String)

          The owner contact information for an API resource.

          This field accepts any string input with a length of 0 - 256 characters.

        • introspectionConfig — (String)

          Sets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.

          For more information about introspection, see GraphQL introspection.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • queryDepthLimit — (Integer)

          The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.

          Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.

        • resolverCountLimit — (Integer)

          The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000. When specified, the limit value can be between 1 and 10000. This field will produce a limit error if the operation falls out of bounds.

        • enhancedMetricsConfig — (map)

          The enhancedMetricsConfig object.

          • resolverLevelMetricsBehaviorrequired — (String)

            Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

            • GraphQL errors: The number of GraphQL errors that occurred.

            • Requests: The number of invocations that occurred during a request.

            • Latency: The time to complete a resolver invocation.

            • Cache hits: The number of cache hits during a request.

            • Cache misses: The number of cache misses during a request.

            These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

            • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_RESOLVER_METRICS"
            • "PER_RESOLVER_METRICS"
          • dataSourceLevelMetricsBehaviorrequired — (String)

            Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

            • Requests: The number of invocations that occured during a request.

            • Latency: The time to complete a data source invocation.

            • Errors: The number of errors that occurred during a data source invocation.

            These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

            • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_DATA_SOURCE_METRICS"
            • "PER_DATA_SOURCE_METRICS"
          • operationLevelMetricsConfigrequired — (String)

            Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

            • Requests: The number of times a specified GraphQL operation was called.

            • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

            Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

            Possible values include:
            • "ENABLED"
            • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createResolver(params = {}, callback) ⇒ AWS.Request

Creates a Resolver object.

A resolver converts incoming requests into a format that a data source can understand, and converts the data source's responses into GraphQL.

Service Reference:

Examples:

Calling the createResolver operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  fieldName: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE', /* required */
  cachingConfig: {
    ttl: 'NUMBER_VALUE', /* required */
    cachingKeys: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  code: 'STRING_VALUE',
  dataSourceName: 'STRING_VALUE',
  kind: UNIT | PIPELINE,
  maxBatchSize: 'NUMBER_VALUE',
  metricsConfig: ENABLED | DISABLED,
  pipelineConfig: {
    functions: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  runtime: {
    name: APPSYNC_JS, /* required */
    runtimeVersion: 'STRING_VALUE' /* required */
  },
  syncConfig: {
    conflictDetection: VERSION | NONE,
    conflictHandler: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE,
    lambdaConflictHandlerConfig: {
      lambdaConflictHandlerArn: 'STRING_VALUE'
    }
  }
};
appsync.createResolver(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The ID for the GraphQL API for which the resolver is being created.

    • typeName — (String)

      The name of the Type.

    • fieldName — (String)

      The name of the field to attach the resolver to.

    • dataSourceName — (String)

      The name of the data source for which the resolver is being created.

    • requestMappingTemplate — (String)

      The mapping template to use for requests.

      A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).

      VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.

    • responseMappingTemplate — (String)

      The mapping template to use for responses from the data source.

    • kind — (String)

      The resolver type.

      • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.

      • PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.

      Possible values include:
      • "UNIT"
      • "PIPELINE"
    • pipelineConfig — (map)

      The PipelineConfig.

      • functions — (Array<String>)

        A list of Function objects.

    • syncConfig — (map)

      The SyncConfig for a resolver attached to a versioned data source.

      • conflictHandler — (String)

        The Conflict Resolution strategy to perform in the event of a conflict.

        • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

        • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

        • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

        Possible values include:
        • "OPTIMISTIC_CONCURRENCY"
        • "LAMBDA"
        • "AUTOMERGE"
        • "NONE"
      • conflictDetection — (String)

        The Conflict Detection strategy to use.

        • VERSION: Detect conflicts based on object versions for this resolver.

        • NONE: Do not detect conflicts when invoking this resolver.

        Possible values include:
        • "VERSION"
        • "NONE"
      • lambdaConflictHandlerConfig — (map)

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

    • cachingConfig — (map)

      The caching configuration for the resolver.

      • ttlrequired — (Integer)

        The TTL in seconds for a resolver that has caching activated.

        Valid values are 1–3,600 seconds.

      • cachingKeys — (Array<String>)

        The caching keys for a resolver that has caching activated.

        Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

    • maxBatchSize — (Integer)

      The maximum batching size for a resolver.

    • runtime — (map)

      Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

      • namerequired — (String)

        The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

        Possible values include:
        • "APPSYNC_JS"
      • runtimeVersionrequired — (String)

        The version of the runtime to use. Currently, the only allowed version is 1.0.0.

    • code — (String)

      The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

    • metricsConfig — (String)

      Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS. If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

      metricsConfig can be ENABLED or DISABLED.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • resolver — (map)

        The Resolver object.

        • typeName — (String)

          The resolver type name.

        • fieldName — (String)

          The resolver field name.

        • dataSourceName — (String)

          The resolver data source name.

        • resolverArn — (String)

          The resolver Amazon Resource Name (ARN).

        • requestMappingTemplate — (String)

          The request mapping template.

        • responseMappingTemplate — (String)

          The response mapping template.

        • kind — (String)

          The resolver type.

          • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.

          Possible values include:
          • "UNIT"
          • "PIPELINE"
        • pipelineConfig — (map)

          The PipelineConfig.

          • functions — (Array<String>)

            A list of Function objects.

        • syncConfig — (map)

          The SyncConfig for a resolver attached to a versioned data source.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttlrequired — (Integer)

            The TTL in seconds for a resolver that has caching activated.

            Valid values are 1–3,600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching activated.

            Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

        • metricsConfig — (String)

          Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS. If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createType(params = {}, callback) ⇒ AWS.Request

Creates a Type object.

Service Reference:

Examples:

Calling the createType operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  definition: 'STRING_VALUE', /* required */
  format: SDL | JSON /* required */
};
appsync.createType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • definition — (String)

      The type definition, in GraphQL Schema Definition Language (SDL) format.

      For more information, see the GraphQL SDL documentation.

    • format — (String)

      The type format: SDL or JSON.

      Possible values include:
      • "SDL"
      • "JSON"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • type — (map)

        The Type object.

        • name — (String)

          The type name.

        • description — (String)

          The type description.

        • arn — (String)

          The type Amazon Resource Name (ARN).

        • definition — (String)

          The type definition.

        • format — (String)

          The type format: SDL or JSON.

          Possible values include:
          • "SDL"
          • "JSON"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteApiCache(params = {}, callback) ⇒ AWS.Request

Deletes an ApiCache object.

Service Reference:

Examples:

Calling the deleteApiCache operation

var params = {
  apiId: 'STRING_VALUE' /* required */
};
appsync.deleteApiCache(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteApiKey(params = {}, callback) ⇒ AWS.Request

Deletes an API key.

Service Reference:

Examples:

Calling the deleteApiKey operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  id: 'STRING_VALUE' /* required */
};
appsync.deleteApiKey(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • id — (String)

      The ID for the API key.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteDataSource(params = {}, callback) ⇒ AWS.Request

Deletes a DataSource object.

Service Reference:

Examples:

Calling the deleteDataSource operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE' /* required */
};
appsync.deleteDataSource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • name — (String)

      The name of the data source.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteDomainName(params = {}, callback) ⇒ AWS.Request

Deletes a custom DomainName object.

Service Reference:

Examples:

Calling the deleteDomainName operation

var params = {
  domainName: 'STRING_VALUE' /* required */
};
appsync.deleteDomainName(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • domainName — (String)

      The domain name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteFunction(params = {}, callback) ⇒ AWS.Request

Deletes a Function.

Service Reference:

Examples:

Calling the deleteFunction operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  functionId: 'STRING_VALUE' /* required */
};
appsync.deleteFunction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The GraphQL API ID.

    • functionId — (String)

      The Function ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteGraphqlApi(params = {}, callback) ⇒ AWS.Request

Deletes a GraphqlApi object.

Service Reference:

Examples:

Calling the deleteGraphqlApi operation

var params = {
  apiId: 'STRING_VALUE' /* required */
};
appsync.deleteGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteResolver(params = {}, callback) ⇒ AWS.Request

Deletes a Resolver object.

Service Reference:

Examples:

Calling the deleteResolver operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  fieldName: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE' /* required */
};
appsync.deleteResolver(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • typeName — (String)

      The name of the resolver type.

    • fieldName — (String)

      The resolver field name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteType(params = {}, callback) ⇒ AWS.Request

Deletes a Type object.

Service Reference:

Examples:

Calling the deleteType operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE' /* required */
};
appsync.deleteType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • typeName — (String)

      The type name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

disassociateApi(params = {}, callback) ⇒ AWS.Request

Removes an ApiAssociation object from a custom domain.

Service Reference:

Examples:

Calling the disassociateApi operation

var params = {
  domainName: 'STRING_VALUE' /* required */
};
appsync.disassociateApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • domainName — (String)

      The domain name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

disassociateMergedGraphqlApi(params = {}, callback) ⇒ AWS.Request

Deletes an association between a Merged API and source API using the source API's identifier and the association ID.

Service Reference:

Examples:

Calling the disassociateMergedGraphqlApi operation

var params = {
  associationId: 'STRING_VALUE', /* required */
  sourceApiIdentifier: 'STRING_VALUE' /* required */
};
appsync.disassociateMergedGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • sourceApiIdentifier — (String)

      The identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API.

    • associationId — (String)

      The ID generated by the AppSync service for the source API association.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociationStatus — (String)

        The state of the source API association.

        Possible values include:
        • "MERGE_SCHEDULED"
        • "MERGE_FAILED"
        • "MERGE_SUCCESS"
        • "MERGE_IN_PROGRESS"
        • "AUTO_MERGE_SCHEDULE_FAILED"
        • "DELETION_SCHEDULED"
        • "DELETION_IN_PROGRESS"
        • "DELETION_FAILED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

disassociateSourceGraphqlApi(params = {}, callback) ⇒ AWS.Request

Deletes an association between a Merged API and source API using the Merged API's identifier and the association ID.

Service Reference:

Examples:

Calling the disassociateSourceGraphqlApi operation

var params = {
  associationId: 'STRING_VALUE', /* required */
  mergedApiIdentifier: 'STRING_VALUE' /* required */
};
appsync.disassociateSourceGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • mergedApiIdentifier — (String)

      The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.

    • associationId — (String)

      The ID generated by the AppSync service for the source API association.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociationStatus — (String)

        The state of the source API association.

        Possible values include:
        • "MERGE_SCHEDULED"
        • "MERGE_FAILED"
        • "MERGE_SUCCESS"
        • "MERGE_IN_PROGRESS"
        • "AUTO_MERGE_SCHEDULE_FAILED"
        • "DELETION_SCHEDULED"
        • "DELETION_IN_PROGRESS"
        • "DELETION_FAILED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

evaluateCode(params = {}, callback) ⇒ AWS.Request

Evaluates the given code and returns the response. The code definition requirements depend on the specified runtime. For APPSYNC_JS runtimes, the code defines the request and response functions. The request function takes the incoming request after a GraphQL operation is parsed and converts it into a request configuration for the selected data source operation. The response function interprets responses from the data source and maps it to the shape of the GraphQL field output type.

Service Reference:

Examples:

Calling the evaluateCode operation

var params = {
  code: 'STRING_VALUE', /* required */
  context: 'STRING_VALUE', /* required */
  runtime: { /* required */
    name: APPSYNC_JS, /* required */
    runtimeVersion: 'STRING_VALUE' /* required */
  },
  function: 'STRING_VALUE'
};
appsync.evaluateCode(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • runtime — (map)

      The runtime to be used when evaluating the code. Currently, only the APPSYNC_JS runtime is supported.

      • namerequired — (String)

        The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

        Possible values include:
        • "APPSYNC_JS"
      • runtimeVersionrequired — (String)

        The version of the runtime to use. Currently, the only allowed version is 1.0.0.

    • code — (String)

      The code definition to be evaluated. Note that code and runtime are both required for this action. The runtime value must be APPSYNC_JS.

    • context — (String)

      The map that holds all of the contextual information for your resolver invocation. A context is required for this action.

    • function — (String)

      The function within the code to be evaluated. If provided, the valid values are request and response.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • evaluationResult — (String)

        The result of the evaluation operation.

      • error — (map)

        Contains the payload of the response error.

        • message — (String)

          The error payload.

        • codeErrors — (Array<map>)

          Contains the list of CodeError objects.

          • errorType — (String)

            The type of code error.

            Examples include, but aren't limited to: LINT_ERROR, PARSER_ERROR.

          • value — (String)

            A user presentable error.

            Examples include, but aren't limited to: Parsing error: Unterminated string literal.

          • location — (map)

            The line, column, and span location of the error in the code.

            • line — (Integer)

              The line number in the code. Defaults to 0 if unknown.

            • column — (Integer)

              The column number in the code. Defaults to 0 if unknown.

            • span — (Integer)

              The span/length of the error. Defaults to -1 if unknown.

      • logs — (Array<String>)

        A list of logs that were generated by calls to util.log.info and util.log.error in the evaluated code.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

evaluateMappingTemplate(params = {}, callback) ⇒ AWS.Request

Evaluates a given template and returns the response. The mapping template can be a request or response template.

Request templates take the incoming request after a GraphQL operation is parsed and convert it into a request configuration for the selected data source operation. Response templates interpret responses from the data source and map it to the shape of the GraphQL field output type.

Mapping templates are written in the Apache Velocity Template Language (VTL).

Service Reference:

Examples:

Calling the evaluateMappingTemplate operation

var params = {
  context: 'STRING_VALUE', /* required */
  template: 'STRING_VALUE' /* required */
};
appsync.evaluateMappingTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • template — (String)

      The mapping template; this can be a request or response template. A template is required for this action.

    • context — (String)

      The map that holds all of the contextual information for your resolver invocation. A context is required for this action.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • evaluationResult — (String)

        The mapping template; this can be a request or response template.

      • error — (map)

        The ErrorDetail object.

        • message — (String)

          The error payload.

      • logs — (Array<String>)

        A list of logs that were generated by calls to util.log.info and util.log.error in the evaluated code.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

flushApiCache(params = {}, callback) ⇒ AWS.Request

Flushes an ApiCache object.

Service Reference:

Examples:

Calling the flushApiCache operation

var params = {
  apiId: 'STRING_VALUE' /* required */
};
appsync.flushApiCache(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getApiAssociation(params = {}, callback) ⇒ AWS.Request

Retrieves an ApiAssociation object.

Service Reference:

Examples:

Calling the getApiAssociation operation

var params = {
  domainName: 'STRING_VALUE' /* required */
};
appsync.getApiAssociation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • domainName — (String)

      The domain name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiAssociation — (map)

        The ApiAssociation object.

        • domainName — (String)

          The domain name.

        • apiId — (String)

          The API ID.

        • associationStatus — (String)

          Identifies the status of an association.

          • PROCESSING: The API association is being created. You cannot modify association requests during processing.

          • SUCCESS: The API association was successful. You can modify associations after success.

          • FAILED: The API association has failed. You can modify associations after failure.

          Possible values include:
          • "PROCESSING"
          • "FAILED"
          • "SUCCESS"
        • deploymentDetail — (String)

          Details about the last deployment status.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getApiCache(params = {}, callback) ⇒ AWS.Request

Retrieves an ApiCache object.

Service Reference:

Examples:

Calling the getApiCache operation

var params = {
  apiId: 'STRING_VALUE' /* required */
};
appsync.getApiCache(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiCache — (map)

        The ApiCache object.

        • ttl — (Integer)

          TTL in seconds for cache entries.

          Valid values are 1–3,600 seconds.

        • apiCachingBehavior — (String)

          Caching behavior.

          • FULL_REQUEST_CACHING: All requests are fully cached.

          • PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.

          Possible values include:
          • "FULL_REQUEST_CACHING"
          • "PER_RESOLVER_CACHING"
        • transitEncryptionEnabled — (Boolean)

          Transit encryption flag when connecting to cache. You cannot update this setting after creation.

        • atRestEncryptionEnabled — (Boolean)

          At-rest encryption flag for cache. You cannot update this setting after creation.

        • type — (String)

          The cache instance type. Valid values are

          • SMALL

          • MEDIUM

          • LARGE

          • XLARGE

          • LARGE_2X

          • LARGE_4X

          • LARGE_8X (not available in all regions)

          • LARGE_12X

          Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.

          The following legacy instance types are available, but their use is discouraged:

          • T2_SMALL: A t2.small instance type.

          • T2_MEDIUM: A t2.medium instance type.

          • R4_LARGE: A r4.large instance type.

          • R4_XLARGE: A r4.xlarge instance type.

          • R4_2XLARGE: A r4.2xlarge instance type.

          • R4_4XLARGE: A r4.4xlarge instance type.

          • R4_8XLARGE: A r4.8xlarge instance type.

          Possible values include:
          • "T2_SMALL"
          • "T2_MEDIUM"
          • "R4_LARGE"
          • "R4_XLARGE"
          • "R4_2XLARGE"
          • "R4_4XLARGE"
          • "R4_8XLARGE"
          • "SMALL"
          • "MEDIUM"
          • "LARGE"
          • "XLARGE"
          • "LARGE_2X"
          • "LARGE_4X"
          • "LARGE_8X"
          • "LARGE_12X"
        • status — (String)

          The cache instance status.

          • AVAILABLE: The instance is available for use.

          • CREATING: The instance is currently creating.

          • DELETING: The instance is currently deleting.

          • MODIFYING: The instance is currently modifying.

          • FAILED: The instance has failed creation.

          Possible values include:
          • "AVAILABLE"
          • "CREATING"
          • "DELETING"
          • "MODIFYING"
          • "FAILED"
        • healthMetricsConfig — (String)

          Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:

          • NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.

          • EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.

          Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDataSource(params = {}, callback) ⇒ AWS.Request

Retrieves a DataSource object.

Service Reference:

Examples:

Calling the getDataSource operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE' /* required */
};
appsync.getDataSource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • name — (String)

      The name of the data source.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • dataSource — (map)

        The DataSource object.

        • dataSourceArn — (String)

          The data source Amazon Resource Name (ARN).

        • name — (String)

          The name of the data source.

        • description — (String)

          The description of the data source.

        • type — (String)

          The type of the data source.

          • AWS_LAMBDA: The data source is an Lambda function.

          • AMAZON_DYNAMODB: The data source is an Amazon DynamoDB table.

          • AMAZON_ELASTICSEARCH: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_OPENSEARCH_SERVICE: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_EVENTBRIDGE: The data source is an Amazon EventBridge configuration.

          • NONE: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.

          • HTTP: The data source is an HTTP endpoint.

          • RELATIONAL_DATABASE: The data source is a relational database.

          Possible values include:
          • "AWS_LAMBDA"
          • "AMAZON_DYNAMODB"
          • "AMAZON_ELASTICSEARCH"
          • "NONE"
          • "HTTP"
          • "RELATIONAL_DATABASE"
          • "AMAZON_OPENSEARCH_SERVICE"
          • "AMAZON_EVENTBRIDGE"
        • serviceRoleArn — (String)

          The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.

        • dynamodbConfig — (map)

          DynamoDB settings.

          • tableNamerequired — (String)

            The table name.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

          • useCallerCredentials — (Boolean)

            Set to TRUE to use Amazon Cognito credentials with this data source.

          • deltaSyncConfig — (map)

            The DeltaSyncConfig for a versioned data source.

            • baseTableTTL — (Integer)

              The number of minutes that an Item is stored in the data source.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.

          • versioned — (Boolean)

            Set to TRUE to use Conflict Detection and Resolution with this data source.

        • lambdaConfig — (map)

          Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The Amazon Resource Name (ARN) for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • openSearchServiceConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • httpConfig — (map)

          HTTP endpoint settings.

          • endpoint — (String)

            The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization configuration in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type that the HTTP endpoint requires.

              • AWS_IAM: The authorization type is Signature Version 4 (SigV4).

              Possible values include:
              • "AWS_IAM"
            • awsIamConfig — (map)

              The Identity and Access Management (IAM) settings.

              • signingRegion — (String)

                The signing Amazon Web Services Region for IAM authorization.

              • signingServiceName — (String)

                The signing service name for IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.

            Possible values include:
            • "RDS_HTTP_ENDPOINT"
          • rdsHttpEndpointConfig — (map)

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for Amazon RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster Amazon Resource Name (ARN).

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.

        • eventBridgeConfig — (map)

          Amazon EventBridge settings.

        • metricsConfig — (String)

          Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDataSourceIntrospection(params = {}, callback) ⇒ AWS.Request

Retrieves the record of an existing introspection. If the retrieval is successful, the result of the instrospection will also be returned. If the retrieval fails the operation, an error message will be returned instead.

Service Reference:

Examples:

Calling the getDataSourceIntrospection operation

var params = {
  introspectionId: 'STRING_VALUE', /* required */
  includeModelsSDL: true || false,
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.getDataSourceIntrospection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • introspectionId — (String)

      The introspection ID. Each introspection contains a unique ID that can be used to reference the instrospection record.

    • includeModelsSDL — (Boolean)

      A boolean flag that determines whether SDL should be generated for introspected types or not. If set to true, each model will contain an sdl property that contains the SDL for that type. The SDL only contains the type data and no additional metadata or directives.

    • nextToken — (String)

      Determines the number of types to be returned in a single response before paginating. This value is typically taken from nextToken value from the previous response.

    • maxResults — (Integer)

      The maximum number of introspected types that will be returned in a single response.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • introspectionId — (String)

        The introspection ID. Each introspection contains a unique ID that can be used to reference the instrospection record.

      • introspectionStatus — (String)

        The status of the introspection during retrieval. By default, when a new instrospection is being retrieved, the status will be set to PROCESSING. Once the operation has been completed, the status will change to SUCCESS or FAILED depending on how the data was parsed. A FAILED operation will return an error and its details as an introspectionStatusDetail.

        Possible values include:
        • "PROCESSING"
        • "FAILED"
        • "SUCCESS"
      • introspectionStatusDetail — (String)

        The error detail field. When a FAILED introspectionStatus is returned, the introspectionStatusDetail will also return the exact error that was generated during the operation.

      • introspectionResult — (map)

        The DataSourceIntrospectionResult object data.

        • models — (Array<map>)

          The array of DataSourceIntrospectionModel objects.

          • name — (String)

            The name of the model. For example, this could be the name of a single table in a database.

          • fields — (Array<map>)

            The DataSourceIntrospectionModelField object data.

            • name — (String)

              The name of the field that was retrieved from the introspected data.

            • type — (map)

              The DataSourceIntrospectionModelFieldType object data.

              • kind — (String)

                Specifies the classification of data. For example, this could be set to values like Scalar or NonNull to indicate a fundamental property of the field.

                Valid values include:

                • Scalar: Indicates the value is a primitive type (scalar).

                • NonNull: Indicates the field cannot be null.

                • List: Indicates the field contains a list.

              • name — (String)

                The name of the data type that represents the field. For example, String is a valid name value.

              • values — (Array<String>)

                The values of the type field. This field represents the AppSync data type equivalent of the introspected field.

            • length — (Integer)

              The length value of the introspected field.

          • primaryKey — (map)

            The primary key stored as a DataSourceIntrospectionModelIndex object.

            • name — (String)

              The name of the index.

            • fields — (Array<String>)

              The fields of the index.

          • indexes — (Array<map>)

            The array of DataSourceIntrospectionModelIndex objects.

            • name — (String)

              The name of the index.

            • fields — (Array<String>)

              The fields of the index.

          • sdl — (String)

            Contains the output of the SDL that was generated from the introspected types. This is controlled by the includeModelsSDL parameter of the GetDataSourceIntrospection operation.

        • nextToken — (String)

          Determines the number of types to be returned in a single response before paginating. This value is typically taken from nextToken value from the previous response.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDomainName(params = {}, callback) ⇒ AWS.Request

Retrieves a custom DomainName object.

Service Reference:

Examples:

Calling the getDomainName operation

var params = {
  domainName: 'STRING_VALUE' /* required */
};
appsync.getDomainName(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • domainName — (String)

      The domain name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • domainNameConfig — (map)

        The configuration for the DomainName.

        • domainName — (String)

          The domain name.

        • description — (String)

          A description of the DomainName configuration.

        • certificateArn — (String)

          The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.

        • appsyncDomainName — (String)

          The domain name that AppSync provides.

        • hostedZoneId — (String)

          The ID of your Amazon Route 53 hosted zone.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getFunction(params = {}, callback) ⇒ AWS.Request

Get a Function.

Service Reference:

Examples:

Calling the getFunction operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  functionId: 'STRING_VALUE' /* required */
};
appsync.getFunction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The GraphQL API ID.

    • functionId — (String)

      The Function ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • functionConfiguration — (map)

        The Function object.

        • functionId — (String)

          A unique ID representing the Function object.

        • functionArn — (String)

          The Amazon Resource Name (ARN) of the Function object.

        • name — (String)

          The name of the Function object.

        • description — (String)

          The Function description.

        • dataSourceName — (String)

          The name of the DataSource.

        • requestMappingTemplate — (String)

          The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

        • responseMappingTemplate — (String)

          The Function response mapping template.

        • functionVersion — (String)

          The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.

        • syncConfig — (map)

          Describes a Sync configuration for a resolver.

          Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGraphqlApi(params = {}, callback) ⇒ AWS.Request

Retrieves a GraphqlApi object.

Service Reference:

Examples:

Calling the getGraphqlApi operation

var params = {
  apiId: 'STRING_VALUE' /* required */
};
appsync.getGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID for the GraphQL API.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • graphqlApi — (map)

        The GraphqlApi object.

        • name — (String)

          The API name.

        • apiId — (String)

          The API ID.

        • authenticationType — (String)

          The authentication type.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
          • "AWS_LAMBDA"
        • logConfig — (map)

          The Amazon CloudWatch Logs configuration.

          • fieldLogLevelrequired — (String)

            The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL.

            • NONE: No field-level logs are captured.

            • ERROR: Logs the following information only for the fields that are in the error category:

              • The error section in the server response.

              • Field-level errors.

              • The generated request/response functions that got resolved for error fields.

            • INFO: Logs the following information only for the fields that are in the info and error categories:

              • Info-level messages.

              • The user messages sent through $util.log.info and console.log.

              • Field-level tracing and mapping logs are not shown.

            • DEBUG: Logs the following information only for the fields that are in the debug, info, and error categories:

              • Debug-level messages.

              • The user messages sent through $util.log.info, $util.log.debug, console.log, and console.debug.

              • Field-level tracing and mapping logs are not shown.

            • ALL: The following information is logged for all fields in the query:

              • Field-level tracing information.

              • The generated request/response functions that were resolved for each field.

            Possible values include:
            • "NONE"
            • "ERROR"
            • "ALL"
            • "INFO"
            • "DEBUG"
          • cloudWatchLogsRoleArnrequired — (String)

            The service role that AppSync assumes to publish to CloudWatch logs in your account.

          • excludeVerboseContent — (Boolean)

            Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

        • userPoolConfig — (map)

          The Amazon Cognito user pool configuration.

          • userPoolIdrequired — (String)

            The user pool ID.

          • awsRegionrequired — (String)

            The Amazon Web Services Region in which the user pool was created.

          • defaultActionrequired — (String)

            The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.

            Possible values include:
            • "ALLOW"
            • "DENY"
          • appIdClientRegex — (String)

            A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

          • clientId — (String)

            The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds that a token is valid after it's issued to a user.

          • authTTL — (Integer)

            The number of milliseconds that a token is valid after being authenticated.

        • arn — (String)

          The Amazon Resource Name (ARN).

        • uris — (map<String>)

          The URIs.

        • tags — (map<String>)

          The tags.

        • additionalAuthenticationProviders — (Array<map>)

          A list of additional authentication providers for the GraphqlApi API.

          • authenticationType — (String)

            The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
            • "AWS_LAMBDA"
          • openIDConnectConfig — (map)

            The OIDC configuration.

            • issuerrequired — (String)

              The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

            • clientId — (String)

              The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds that a token is valid after it's issued to a user.

            • authTTL — (Integer)

              The number of milliseconds that a token is valid after being authenticated.

          • userPoolConfig — (map)

            The Amazon Cognito user pool configuration.

            • userPoolIdrequired — (String)

              The user pool ID.

            • awsRegionrequired — (String)

              The Amazon Web Services Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

          • lambdaAuthorizerConfig — (map)

            Configuration for Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

            • authorizerUrirequired — (String)

              The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

              Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

              aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

            • identityValidationExpression — (String)

              A regular expression for validation of tokens before the Lambda function is called.

        • xrayEnabled — (Boolean)

          A flag indicating whether to use X-Ray tracing for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

          • authorizerUrirequired — (String)

            The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

            Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

            aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

          • identityValidationExpression — (String)

            A regular expression for validation of tokens before the Lambda function is called.

        • dns — (map<String>)

          The DNS records for the API.

        • visibility — (String)

          Sets the value of the GraphQL API to public (GLOBAL) or private (PRIVATE). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.

          Possible values include:
          • "GLOBAL"
          • "PRIVATE"
        • apiType — (String)

          The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED).

          Possible values include:
          • "GRAPHQL"
          • "MERGED"
        • mergedApiExecutionRoleArn — (String)

          The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.

        • owner — (String)

          The account owner of the GraphQL API.

        • ownerContact — (String)

          The owner contact information for an API resource.

          This field accepts any string input with a length of 0 - 256 characters.

        • introspectionConfig — (String)

          Sets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.

          For more information about introspection, see GraphQL introspection.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • queryDepthLimit — (Integer)

          The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.

          Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.

        • resolverCountLimit — (Integer)

          The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000. When specified, the limit value can be between 1 and 10000. This field will produce a limit error if the operation falls out of bounds.

        • enhancedMetricsConfig — (map)

          The enhancedMetricsConfig object.

          • resolverLevelMetricsBehaviorrequired — (String)

            Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

            • GraphQL errors: The number of GraphQL errors that occurred.

            • Requests: The number of invocations that occurred during a request.

            • Latency: The time to complete a resolver invocation.

            • Cache hits: The number of cache hits during a request.

            • Cache misses: The number of cache misses during a request.

            These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

            • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_RESOLVER_METRICS"
            • "PER_RESOLVER_METRICS"
          • dataSourceLevelMetricsBehaviorrequired — (String)

            Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

            • Requests: The number of invocations that occured during a request.

            • Latency: The time to complete a data source invocation.

            • Errors: The number of errors that occurred during a data source invocation.

            These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

            • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_DATA_SOURCE_METRICS"
            • "PER_DATA_SOURCE_METRICS"
          • operationLevelMetricsConfigrequired — (String)

            Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

            • Requests: The number of times a specified GraphQL operation was called.

            • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

            Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

            Possible values include:
            • "ENABLED"
            • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGraphqlApiEnvironmentVariables(params = {}, callback) ⇒ AWS.Request

Retrieves the list of environmental variable key-value pairs associated with an API by its ID value.

Examples:

Calling the getGraphqlApiEnvironmentVariables operation

var params = {
  apiId: 'STRING_VALUE' /* required */
};
appsync.getGraphqlApiEnvironmentVariables(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The ID of the API from which the environmental variable list will be retrieved.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • environmentVariables — (map<String>)

        The payload containing each environmental variable in the "key" : "value" format.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getIntrospectionSchema(params = {}, callback) ⇒ AWS.Request

Retrieves the introspection schema for a GraphQL API.

Service Reference:

Examples:

Calling the getIntrospectionSchema operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  format: SDL | JSON, /* required */
  includeDirectives: true || false
};
appsync.getIntrospectionSchema(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • format — (String)

      The schema format: SDL or JSON.

      Possible values include:
      • "SDL"
      • "JSON"
    • includeDirectives — (Boolean)

      A flag that specifies whether the schema introspection should contain directives.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • schema — (Buffer(Node.js), Typed Array(Browser))

        The schema, in GraphQL Schema Definition Language (SDL) format.

        For more information, see the GraphQL SDL documentation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getResolver(params = {}, callback) ⇒ AWS.Request

Retrieves a Resolver object.

Service Reference:

Examples:

Calling the getResolver operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  fieldName: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE' /* required */
};
appsync.getResolver(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • typeName — (String)

      The resolver type name.

    • fieldName — (String)

      The resolver field name.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • resolver — (map)

        The Resolver object.

        • typeName — (String)

          The resolver type name.

        • fieldName — (String)

          The resolver field name.

        • dataSourceName — (String)

          The resolver data source name.

        • resolverArn — (String)

          The resolver Amazon Resource Name (ARN).

        • requestMappingTemplate — (String)

          The request mapping template.

        • responseMappingTemplate — (String)

          The response mapping template.

        • kind — (String)

          The resolver type.

          • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.

          Possible values include:
          • "UNIT"
          • "PIPELINE"
        • pipelineConfig — (map)

          The PipelineConfig.

          • functions — (Array<String>)

            A list of Function objects.

        • syncConfig — (map)

          The SyncConfig for a resolver attached to a versioned data source.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttlrequired — (Integer)

            The TTL in seconds for a resolver that has caching activated.

            Valid values are 1–3,600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching activated.

            Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

        • metricsConfig — (String)

          Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS. If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSchemaCreationStatus(params = {}, callback) ⇒ AWS.Request

Retrieves the current status of a schema creation operation.

Service Reference:

Examples:

Calling the getSchemaCreationStatus operation

var params = {
  apiId: 'STRING_VALUE' /* required */
};
appsync.getSchemaCreationStatus(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • status — (String)

        The current state of the schema (PROCESSING, FAILED, SUCCESS, or NOT_APPLICABLE). When the schema is in the ACTIVE state, you can add data.

        Possible values include:
        • "PROCESSING"
        • "ACTIVE"
        • "DELETING"
        • "FAILED"
        • "SUCCESS"
        • "NOT_APPLICABLE"
      • details — (String)

        Detailed information about the status of the schema creation operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSourceApiAssociation(params = {}, callback) ⇒ AWS.Request

Retrieves a SourceApiAssociation object.

Service Reference:

Examples:

Calling the getSourceApiAssociation operation

var params = {
  associationId: 'STRING_VALUE', /* required */
  mergedApiIdentifier: 'STRING_VALUE' /* required */
};
appsync.getSourceApiAssociation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • mergedApiIdentifier — (String)

      The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.

    • associationId — (String)

      The ID generated by the AppSync service for the source API association.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociation — (map)

        The SourceApiAssociation object data.

        • associationId — (String)

          The ID generated by the AppSync service for the source API association.

        • associationArn — (String)

          The Amazon Resource Name (ARN) of the source API association.

        • sourceApiId — (String)

          The ID of the AppSync source API.

        • sourceApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync source API.

        • mergedApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync Merged API.

        • mergedApiId — (String)

          The ID of the AppSync Merged API.

        • description — (String)

          The description field.

        • sourceApiAssociationConfig — (map)

          The SourceApiAssociationConfig object data.

          • mergeType — (String)

            The property that indicates which merging option is enabled in the source API association.

            Valid merge types are MANUAL_MERGE (default) and AUTO_MERGE. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use MergedApiExecutionRoleArn to perform merge operations.

            Possible values include:
            • "MANUAL_MERGE"
            • "AUTO_MERGE"
        • sourceApiAssociationStatus — (String)

          The state of the source API association.

          Possible values include:
          • "MERGE_SCHEDULED"
          • "MERGE_FAILED"
          • "MERGE_SUCCESS"
          • "MERGE_IN_PROGRESS"
          • "AUTO_MERGE_SCHEDULE_FAILED"
          • "DELETION_SCHEDULED"
          • "DELETION_IN_PROGRESS"
          • "DELETION_FAILED"
        • sourceApiAssociationStatusDetail — (String)

          The detailed message related to the current state of the source API association.

        • lastSuccessfulMergeDate — (Date)

          The datetime value of the last successful merge of the source API association. The result will be in UTC format and your local time zone.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getType(params = {}, callback) ⇒ AWS.Request

Retrieves a Type object.

Service Reference:

Examples:

Calling the getType operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  format: SDL | JSON, /* required */
  typeName: 'STRING_VALUE' /* required */
};
appsync.getType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • typeName — (String)

      The type name.

    • format — (String)

      The type format: SDL or JSON.

      Possible values include:
      • "SDL"
      • "JSON"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • type — (map)

        The Type object.

        • name — (String)

          The type name.

        • description — (String)

          The type description.

        • arn — (String)

          The type Amazon Resource Name (ARN).

        • definition — (String)

          The type definition.

        • format — (String)

          The type format: SDL or JSON.

          Possible values include:
          • "SDL"
          • "JSON"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listApiKeys(params = {}, callback) ⇒ AWS.Request

Lists the API keys for a given API.

Note: API keys are deleted automatically 60 days after they expire. However, they may still be included in the response until they have actually been deleted. You can safely call DeleteApiKey to manually delete a key before it's automatically deleted.

Service Reference:

Examples:

Calling the listApiKeys operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listApiKeys(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiKeys — (Array<map>)

        The ApiKey objects.

        • id — (String)

          The API key ID.

        • description — (String)

          A description of the purpose of the API key.

        • expires — (Integer)

          The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

        • deletes — (Integer)

          The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.

      • nextToken — (String)

        An identifier to pass in the next request to this operation to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listDataSources(params = {}, callback) ⇒ AWS.Request

Lists the data sources for a given API.

Service Reference:

Examples:

Calling the listDataSources operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listDataSources(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • dataSources — (Array<map>)

        The DataSource objects.

        • dataSourceArn — (String)

          The data source Amazon Resource Name (ARN).

        • name — (String)

          The name of the data source.

        • description — (String)

          The description of the data source.

        • type — (String)

          The type of the data source.

          • AWS_LAMBDA: The data source is an Lambda function.

          • AMAZON_DYNAMODB: The data source is an Amazon DynamoDB table.

          • AMAZON_ELASTICSEARCH: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_OPENSEARCH_SERVICE: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_EVENTBRIDGE: The data source is an Amazon EventBridge configuration.

          • NONE: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.

          • HTTP: The data source is an HTTP endpoint.

          • RELATIONAL_DATABASE: The data source is a relational database.

          Possible values include:
          • "AWS_LAMBDA"
          • "AMAZON_DYNAMODB"
          • "AMAZON_ELASTICSEARCH"
          • "NONE"
          • "HTTP"
          • "RELATIONAL_DATABASE"
          • "AMAZON_OPENSEARCH_SERVICE"
          • "AMAZON_EVENTBRIDGE"
        • serviceRoleArn — (String)

          The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.

        • dynamodbConfig — (map)

          DynamoDB settings.

          • tableNamerequired — (String)

            The table name.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

          • useCallerCredentials — (Boolean)

            Set to TRUE to use Amazon Cognito credentials with this data source.

          • deltaSyncConfig — (map)

            The DeltaSyncConfig for a versioned data source.

            • baseTableTTL — (Integer)

              The number of minutes that an Item is stored in the data source.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.

          • versioned — (Boolean)

            Set to TRUE to use Conflict Detection and Resolution with this data source.

        • lambdaConfig — (map)

          Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The Amazon Resource Name (ARN) for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • openSearchServiceConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • httpConfig — (map)

          HTTP endpoint settings.

          • endpoint — (String)

            The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization configuration in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type that the HTTP endpoint requires.

              • AWS_IAM: The authorization type is Signature Version 4 (SigV4).

              Possible values include:
              • "AWS_IAM"
            • awsIamConfig — (map)

              The Identity and Access Management (IAM) settings.

              • signingRegion — (String)

                The signing Amazon Web Services Region for IAM authorization.

              • signingServiceName — (String)

                The signing service name for IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.

            Possible values include:
            • "RDS_HTTP_ENDPOINT"
          • rdsHttpEndpointConfig — (map)

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for Amazon RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster Amazon Resource Name (ARN).

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.

        • eventBridgeConfig — (map)

          Amazon EventBridge settings.

        • metricsConfig — (String)

          Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
      • nextToken — (String)

        An identifier to pass in the next request to this operation to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listDomainNames(params = {}, callback) ⇒ AWS.Request

Lists multiple custom domain names.

Service Reference:

Examples:

Calling the listDomainNames operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listDomainNames(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • domainNameConfigs — (Array<map>)

        Lists configurations for multiple domain names.

        • domainName — (String)

          The domain name.

        • description — (String)

          A description of the DomainName configuration.

        • certificateArn — (String)

          The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.

        • appsyncDomainName — (String)

          The domain name that AppSync provides.

        • hostedZoneId — (String)

          The ID of your Amazon Route 53 hosted zone.

      • nextToken — (String)

        An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listFunctions(params = {}, callback) ⇒ AWS.Request

List multiple functions.

Service Reference:

Examples:

Calling the listFunctions operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listFunctions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The GraphQL API ID.

    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • functions — (Array<map>)

        A list of Function objects.

        • functionId — (String)

          A unique ID representing the Function object.

        • functionArn — (String)

          The Amazon Resource Name (ARN) of the Function object.

        • name — (String)

          The name of the Function object.

        • description — (String)

          The Function description.

        • dataSourceName — (String)

          The name of the DataSource.

        • requestMappingTemplate — (String)

          The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

        • responseMappingTemplate — (String)

          The Function response mapping template.

        • functionVersion — (String)

          The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.

        • syncConfig — (map)

          Describes a Sync configuration for a resolver.

          Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

      • nextToken — (String)

        An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listGraphqlApis(params = {}, callback) ⇒ AWS.Request

Lists your GraphQL APIs.

Service Reference:

Examples:

Calling the listGraphqlApis operation

var params = {
  apiType: GRAPHQL | MERGED,
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  owner: CURRENT_ACCOUNT | OTHER_ACCOUNTS
};
appsync.listGraphqlApis(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

    • apiType — (String)

      The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED).

      Possible values include:
      • "GRAPHQL"
      • "MERGED"
    • owner — (String)

      The account owner of the GraphQL API.

      Possible values include:
      • "CURRENT_ACCOUNT"
      • "OTHER_ACCOUNTS"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • graphqlApis — (Array<map>)

        The GraphqlApi objects.

        • name — (String)

          The API name.

        • apiId — (String)

          The API ID.

        • authenticationType — (String)

          The authentication type.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
          • "AWS_LAMBDA"
        • logConfig — (map)

          The Amazon CloudWatch Logs configuration.

          • fieldLogLevelrequired — (String)

            The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL.

            • NONE: No field-level logs are captured.

            • ERROR: Logs the following information only for the fields that are in the error category:

              • The error section in the server response.

              • Field-level errors.

              • The generated request/response functions that got resolved for error fields.

            • INFO: Logs the following information only for the fields that are in the info and error categories:

              • Info-level messages.

              • The user messages sent through $util.log.info and console.log.

              • Field-level tracing and mapping logs are not shown.

            • DEBUG: Logs the following information only for the fields that are in the debug, info, and error categories:

              • Debug-level messages.

              • The user messages sent through $util.log.info, $util.log.debug, console.log, and console.debug.

              • Field-level tracing and mapping logs are not shown.

            • ALL: The following information is logged for all fields in the query:

              • Field-level tracing information.

              • The generated request/response functions that were resolved for each field.

            Possible values include:
            • "NONE"
            • "ERROR"
            • "ALL"
            • "INFO"
            • "DEBUG"
          • cloudWatchLogsRoleArnrequired — (String)

            The service role that AppSync assumes to publish to CloudWatch logs in your account.

          • excludeVerboseContent — (Boolean)

            Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

        • userPoolConfig — (map)

          The Amazon Cognito user pool configuration.

          • userPoolIdrequired — (String)

            The user pool ID.

          • awsRegionrequired — (String)

            The Amazon Web Services Region in which the user pool was created.

          • defaultActionrequired — (String)

            The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.

            Possible values include:
            • "ALLOW"
            • "DENY"
          • appIdClientRegex — (String)

            A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

          • clientId — (String)

            The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds that a token is valid after it's issued to a user.

          • authTTL — (Integer)

            The number of milliseconds that a token is valid after being authenticated.

        • arn — (String)

          The Amazon Resource Name (ARN).

        • uris — (map<String>)

          The URIs.

        • tags — (map<String>)

          The tags.

        • additionalAuthenticationProviders — (Array<map>)

          A list of additional authentication providers for the GraphqlApi API.

          • authenticationType — (String)

            The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
            • "AWS_LAMBDA"
          • openIDConnectConfig — (map)

            The OIDC configuration.

            • issuerrequired — (String)

              The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

            • clientId — (String)

              The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds that a token is valid after it's issued to a user.

            • authTTL — (Integer)

              The number of milliseconds that a token is valid after being authenticated.

          • userPoolConfig — (map)

            The Amazon Cognito user pool configuration.

            • userPoolIdrequired — (String)

              The user pool ID.

            • awsRegionrequired — (String)

              The Amazon Web Services Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

          • lambdaAuthorizerConfig — (map)

            Configuration for Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

            • authorizerUrirequired — (String)

              The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

              Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

              aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

            • identityValidationExpression — (String)

              A regular expression for validation of tokens before the Lambda function is called.

        • xrayEnabled — (Boolean)

          A flag indicating whether to use X-Ray tracing for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

          • authorizerUrirequired — (String)

            The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

            Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

            aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

          • identityValidationExpression — (String)

            A regular expression for validation of tokens before the Lambda function is called.

        • dns — (map<String>)

          The DNS records for the API.

        • visibility — (String)

          Sets the value of the GraphQL API to public (GLOBAL) or private (PRIVATE). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.

          Possible values include:
          • "GLOBAL"
          • "PRIVATE"
        • apiType — (String)

          The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED).

          Possible values include:
          • "GRAPHQL"
          • "MERGED"
        • mergedApiExecutionRoleArn — (String)

          The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.

        • owner — (String)

          The account owner of the GraphQL API.

        • ownerContact — (String)

          The owner contact information for an API resource.

          This field accepts any string input with a length of 0 - 256 characters.

        • introspectionConfig — (String)

          Sets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.

          For more information about introspection, see GraphQL introspection.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • queryDepthLimit — (Integer)

          The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.

          Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.

        • resolverCountLimit — (Integer)

          The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000. When specified, the limit value can be between 1 and 10000. This field will produce a limit error if the operation falls out of bounds.

        • enhancedMetricsConfig — (map)

          The enhancedMetricsConfig object.

          • resolverLevelMetricsBehaviorrequired — (String)

            Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

            • GraphQL errors: The number of GraphQL errors that occurred.

            • Requests: The number of invocations that occurred during a request.

            • Latency: The time to complete a resolver invocation.

            • Cache hits: The number of cache hits during a request.

            • Cache misses: The number of cache misses during a request.

            These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

            • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_RESOLVER_METRICS"
            • "PER_RESOLVER_METRICS"
          • dataSourceLevelMetricsBehaviorrequired — (String)

            Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

            • Requests: The number of invocations that occured during a request.

            • Latency: The time to complete a data source invocation.

            • Errors: The number of errors that occurred during a data source invocation.

            These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

            • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_DATA_SOURCE_METRICS"
            • "PER_DATA_SOURCE_METRICS"
          • operationLevelMetricsConfigrequired — (String)

            Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

            • Requests: The number of times a specified GraphQL operation was called.

            • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

            Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

            Possible values include:
            • "ENABLED"
            • "DISABLED"
      • nextToken — (String)

        An identifier to pass in the next request to this operation to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listResolvers(params = {}, callback) ⇒ AWS.Request

Lists the resolvers for a given API and type.

Service Reference:

Examples:

Calling the listResolvers operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listResolvers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • typeName — (String)

      The type name.

    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • resolvers — (Array<map>)

        The Resolver objects.

        • typeName — (String)

          The resolver type name.

        • fieldName — (String)

          The resolver field name.

        • dataSourceName — (String)

          The resolver data source name.

        • resolverArn — (String)

          The resolver Amazon Resource Name (ARN).

        • requestMappingTemplate — (String)

          The request mapping template.

        • responseMappingTemplate — (String)

          The response mapping template.

        • kind — (String)

          The resolver type.

          • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.

          Possible values include:
          • "UNIT"
          • "PIPELINE"
        • pipelineConfig — (map)

          The PipelineConfig.

          • functions — (Array<String>)

            A list of Function objects.

        • syncConfig — (map)

          The SyncConfig for a resolver attached to a versioned data source.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttlrequired — (Integer)

            The TTL in seconds for a resolver that has caching activated.

            Valid values are 1–3,600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching activated.

            Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

        • metricsConfig — (String)

          Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS. If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
      • nextToken — (String)

        An identifier to pass in the next request to this operation to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listResolversByFunction(params = {}, callback) ⇒ AWS.Request

List the resolvers that are associated with a specific function.

Service Reference:

Examples:

Calling the listResolversByFunction operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  functionId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listResolversByFunction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • functionId — (String)

      The function ID.

    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • resolvers — (Array<map>)

        The list of resolvers.

        • typeName — (String)

          The resolver type name.

        • fieldName — (String)

          The resolver field name.

        • dataSourceName — (String)

          The resolver data source name.

        • resolverArn — (String)

          The resolver Amazon Resource Name (ARN).

        • requestMappingTemplate — (String)

          The request mapping template.

        • responseMappingTemplate — (String)

          The response mapping template.

        • kind — (String)

          The resolver type.

          • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.

          Possible values include:
          • "UNIT"
          • "PIPELINE"
        • pipelineConfig — (map)

          The PipelineConfig.

          • functions — (Array<String>)

            A list of Function objects.

        • syncConfig — (map)

          The SyncConfig for a resolver attached to a versioned data source.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttlrequired — (Integer)

            The TTL in seconds for a resolver that has caching activated.

            Valid values are 1–3,600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching activated.

            Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

        • metricsConfig — (String)

          Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS. If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
      • nextToken — (String)

        An identifier that you can use to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listSourceApiAssociations(params = {}, callback) ⇒ AWS.Request

Lists the SourceApiAssociationSummary data.

Service Reference:

Examples:

Calling the listSourceApiAssociations operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listSourceApiAssociations(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociationSummaries — (Array<map>)

        The SourceApiAssociationSummary object data.

        • associationId — (String)

          The ID generated by the AppSync service for the source API association.

        • associationArn — (String)

          The Amazon Resource Name (ARN) of the source API association.

        • sourceApiId — (String)

          The ID of the AppSync source API.

        • sourceApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync Source API.

        • mergedApiId — (String)

          The ID of the AppSync Merged API.

        • mergedApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync Merged API.

        • description — (String)

          The description field.

      • nextToken — (String)

        An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Lists the tags for a resource.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  resourceArn: 'STRING_VALUE' /* required */
};
appsync.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The GraphqlApi Amazon Resource Name (ARN).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • tags — (map<String>)

        A TagMap object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTypes(params = {}, callback) ⇒ AWS.Request

Lists the types for a given API.

Service Reference:

Examples:

Calling the listTypes operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  format: SDL | JSON, /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listTypes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • format — (String)

      The type format: SDL or JSON.

      Possible values include:
      • "SDL"
      • "JSON"
    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • types — (Array<map>)

        The Type objects.

        • name — (String)

          The type name.

        • description — (String)

          The type description.

        • arn — (String)

          The type Amazon Resource Name (ARN).

        • definition — (String)

          The type definition.

        • format — (String)

          The type format: SDL or JSON.

          Possible values include:
          • "SDL"
          • "JSON"
      • nextToken — (String)

        An identifier to pass in the next request to this operation to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTypesByAssociation(params = {}, callback) ⇒ AWS.Request

Lists Type objects by the source API association ID.

Service Reference:

Examples:

Calling the listTypesByAssociation operation

var params = {
  associationId: 'STRING_VALUE', /* required */
  format: SDL | JSON, /* required */
  mergedApiIdentifier: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
appsync.listTypesByAssociation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • mergedApiIdentifier — (String)

      The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.

    • associationId — (String)

      The ID generated by the AppSync service for the source API association.

    • format — (String)

      The format type.

      Possible values include:
      • "SDL"
      • "JSON"
    • nextToken — (String)

      An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results that you want the request to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • types — (Array<map>)

        The Type objects.

        • name — (String)

          The type name.

        • description — (String)

          The type description.

        • arn — (String)

          The type Amazon Resource Name (ARN).

        • definition — (String)

          The type definition.

        • format — (String)

          The type format: SDL or JSON.

          Possible values include:
          • "SDL"
          • "JSON"
      • nextToken — (String)

        An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putGraphqlApiEnvironmentVariables(params = {}, callback) ⇒ AWS.Request

Creates a list of environmental variables in an API by its ID value.

When creating an environmental variable, it must follow the constraints below:

  • Both JavaScript and VTL templates support environmental variables.

  • Environmental variables are not evaluated before function invocation.

  • Environmental variables only support string values.

  • Any defined value in an environmental variable is considered a string literal and not expanded.

  • Variable evaluations should ideally be performed in the function code.

When creating an environmental variable key-value pair, it must follow the additional constraints below:

  • Keys must begin with a letter.

  • Keys must be at least two characters long.

  • Keys can only contain letters, numbers, and the underscore character (_).

  • Values can be up to 512 characters long.

  • You can configure up to 50 key-value pairs in a GraphQL API.

You can create a list of environmental variables by adding it to the environmentVariables payload as a list in the format {"key1":"value1","key2":"value2", …}. Note that each call of the PutGraphqlApiEnvironmentVariables action will result in the overwriting of the existing environmental variable list of that API. This means the existing environmental variables will be lost. To avoid this, you must include all existing and new environmental variables in the list each time you call this action.

Examples:

Calling the putGraphqlApiEnvironmentVariables operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  environmentVariables: { /* required */
    '<EnvironmentVariableKey>': 'STRING_VALUE',
    /* '<EnvironmentVariableKey>': ... */
  }
};
appsync.putGraphqlApiEnvironmentVariables(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The ID of the API to which the environmental variable list will be written.

    • environmentVariables — (map<String>)

      The list of environmental variables to add to the API.

      When creating an environmental variable key-value pair, it must follow the additional constraints below:

      • Keys must begin with a letter.

      • Keys must be at least two characters long.

      • Keys can only contain letters, numbers, and the underscore character (_).

      • Values can be up to 512 characters long.

      • You can configure up to 50 key-value pairs in a GraphQL API.

      You can create a list of environmental variables by adding it to the environmentVariables payload as a list in the format {"key1":"value1","key2":"value2", …}. Note that each call of the PutGraphqlApiEnvironmentVariables action will result in the overwriting of the existing environmental variable list of that API. This means the existing environmental variables will be lost. To avoid this, you must include all existing and new environmental variables in the list each time you call this action.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • environmentVariables — (map<String>)

        The payload containing each environmental variable in the "key" : "value" format.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

startDataSourceIntrospection(params = {}, callback) ⇒ AWS.Request

Creates a new introspection. Returns the introspectionId of the new introspection after its creation.

Service Reference:

Examples:

Calling the startDataSourceIntrospection operation

var params = {
  rdsDataApiConfig: {
    databaseName: 'STRING_VALUE', /* required */
    resourceArn: 'STRING_VALUE', /* required */
    secretArn: 'STRING_VALUE' /* required */
  }
};
appsync.startDataSourceIntrospection(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • rdsDataApiConfig — (map)

      The rdsDataApiConfig object data.

      • resourceArnrequired — (String)

        The resource ARN of the RDS cluster.

      • secretArnrequired — (String)

        The secret's ARN that was obtained from Secrets Manager. A secret consists of secret information, the secret value, plus metadata about the secret. A secret value can be a string or binary. It typically includes the ARN, secret name and description, policies, tags, encryption key from the Key Management Service, and key rotation data.

      • databaseNamerequired — (String)

        The name of the database in the cluster.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • introspectionId — (String)

        The introspection ID. Each introspection contains a unique ID that can be used to reference the instrospection record.

      • introspectionStatus — (String)

        The status of the introspection during creation. By default, when a new instrospection has been created, the status will be set to PROCESSING. Once the operation has been completed, the status will change to SUCCESS or FAILED depending on how the data was parsed. A FAILED operation will return an error and its details as an introspectionStatusDetail.

        Possible values include:
        • "PROCESSING"
        • "FAILED"
        • "SUCCESS"
      • introspectionStatusDetail — (String)

        The error detail field. When a FAILED introspectionStatus is returned, the introspectionStatusDetail will also return the exact error that was generated during the operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

startSchemaCreation(params = {}, callback) ⇒ AWS.Request

Adds a new schema to your GraphQL API.

This operation is asynchronous. Use to determine when it has completed.

Service Reference:

Examples:

Calling the startSchemaCreation operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  definition: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */ /* required */
};
appsync.startSchemaCreation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • definition — (Buffer, Typed Array, Blob, String)

      The schema definition, in GraphQL schema language format.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • status — (String)

        The current state of the schema (PROCESSING, FAILED, SUCCESS, or NOT_APPLICABLE). When the schema is in the ACTIVE state, you can add data.

        Possible values include:
        • "PROCESSING"
        • "ACTIVE"
        • "DELETING"
        • "FAILED"
        • "SUCCESS"
        • "NOT_APPLICABLE"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

startSchemaMerge(params = {}, callback) ⇒ AWS.Request

Initiates a merge operation. Returns a status that shows the result of the merge operation.

Service Reference:

Examples:

Calling the startSchemaMerge operation

var params = {
  associationId: 'STRING_VALUE', /* required */
  mergedApiIdentifier: 'STRING_VALUE' /* required */
};
appsync.startSchemaMerge(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • associationId — (String)

      The ID generated by the AppSync service for the source API association.

    • mergedApiIdentifier — (String)

      The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociationStatus — (String)

        The state of the source API association.

        Possible values include:
        • "MERGE_SCHEDULED"
        • "MERGE_FAILED"
        • "MERGE_SUCCESS"
        • "MERGE_IN_PROGRESS"
        • "AUTO_MERGE_SCHEDULE_FAILED"
        • "DELETION_SCHEDULED"
        • "DELETION_IN_PROGRESS"
        • "DELETION_FAILED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

Tags a resource with user-supplied tags.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tags: { /* required */
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
appsync.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The GraphqlApi Amazon Resource Name (ARN).

    • tags — (map<String>)

      A TagMap object.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

Untags a resource.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
appsync.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The GraphqlApi Amazon Resource Name (ARN).

    • tagKeys — (Array<String>)

      A list of TagKey objects.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateApiCache(params = {}, callback) ⇒ AWS.Request

Updates the cache for the GraphQL API.

Service Reference:

Examples:

Calling the updateApiCache operation

var params = {
  apiCachingBehavior: FULL_REQUEST_CACHING | PER_RESOLVER_CACHING, /* required */
  apiId: 'STRING_VALUE', /* required */
  ttl: 'NUMBER_VALUE', /* required */
  type: T2_SMALL | T2_MEDIUM | R4_LARGE | R4_XLARGE | R4_2XLARGE | R4_4XLARGE | R4_8XLARGE | SMALL | MEDIUM | LARGE | XLARGE | LARGE_2X | LARGE_4X | LARGE_8X | LARGE_12X, /* required */
  healthMetricsConfig: ENABLED | DISABLED
};
appsync.updateApiCache(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The GraphQL API ID.

    • ttl — (Integer)

      TTL in seconds for cache entries.

      Valid values are 1–3,600 seconds.

    • apiCachingBehavior — (String)

      Caching behavior.

      • FULL_REQUEST_CACHING: All requests are fully cached.

      • PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.

      Possible values include:
      • "FULL_REQUEST_CACHING"
      • "PER_RESOLVER_CACHING"
    • type — (String)

      The cache instance type. Valid values are

      • SMALL

      • MEDIUM

      • LARGE

      • XLARGE

      • LARGE_2X

      • LARGE_4X

      • LARGE_8X (not available in all regions)

      • LARGE_12X

      Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.

      The following legacy instance types are available, but their use is discouraged:

      • T2_SMALL: A t2.small instance type.

      • T2_MEDIUM: A t2.medium instance type.

      • R4_LARGE: A r4.large instance type.

      • R4_XLARGE: A r4.xlarge instance type.

      • R4_2XLARGE: A r4.2xlarge instance type.

      • R4_4XLARGE: A r4.4xlarge instance type.

      • R4_8XLARGE: A r4.8xlarge instance type.

      Possible values include:
      • "T2_SMALL"
      • "T2_MEDIUM"
      • "R4_LARGE"
      • "R4_XLARGE"
      • "R4_2XLARGE"
      • "R4_4XLARGE"
      • "R4_8XLARGE"
      • "SMALL"
      • "MEDIUM"
      • "LARGE"
      • "XLARGE"
      • "LARGE_2X"
      • "LARGE_4X"
      • "LARGE_8X"
      • "LARGE_12X"
    • healthMetricsConfig — (String)

      Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:

      • NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.

      • EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.

      Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiCache — (map)

        The ApiCache object.

        • ttl — (Integer)

          TTL in seconds for cache entries.

          Valid values are 1–3,600 seconds.

        • apiCachingBehavior — (String)

          Caching behavior.

          • FULL_REQUEST_CACHING: All requests are fully cached.

          • PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.

          Possible values include:
          • "FULL_REQUEST_CACHING"
          • "PER_RESOLVER_CACHING"
        • transitEncryptionEnabled — (Boolean)

          Transit encryption flag when connecting to cache. You cannot update this setting after creation.

        • atRestEncryptionEnabled — (Boolean)

          At-rest encryption flag for cache. You cannot update this setting after creation.

        • type — (String)

          The cache instance type. Valid values are

          • SMALL

          • MEDIUM

          • LARGE

          • XLARGE

          • LARGE_2X

          • LARGE_4X

          • LARGE_8X (not available in all regions)

          • LARGE_12X

          Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.

          The following legacy instance types are available, but their use is discouraged:

          • T2_SMALL: A t2.small instance type.

          • T2_MEDIUM: A t2.medium instance type.

          • R4_LARGE: A r4.large instance type.

          • R4_XLARGE: A r4.xlarge instance type.

          • R4_2XLARGE: A r4.2xlarge instance type.

          • R4_4XLARGE: A r4.4xlarge instance type.

          • R4_8XLARGE: A r4.8xlarge instance type.

          Possible values include:
          • "T2_SMALL"
          • "T2_MEDIUM"
          • "R4_LARGE"
          • "R4_XLARGE"
          • "R4_2XLARGE"
          • "R4_4XLARGE"
          • "R4_8XLARGE"
          • "SMALL"
          • "MEDIUM"
          • "LARGE"
          • "XLARGE"
          • "LARGE_2X"
          • "LARGE_4X"
          • "LARGE_8X"
          • "LARGE_12X"
        • status — (String)

          The cache instance status.

          • AVAILABLE: The instance is available for use.

          • CREATING: The instance is currently creating.

          • DELETING: The instance is currently deleting.

          • MODIFYING: The instance is currently modifying.

          • FAILED: The instance has failed creation.

          Possible values include:
          • "AVAILABLE"
          • "CREATING"
          • "DELETING"
          • "MODIFYING"
          • "FAILED"
        • healthMetricsConfig — (String)

          Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:

          • NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.

          • EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.

          Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateApiKey(params = {}, callback) ⇒ AWS.Request

Updates an API key. You can update the key as long as it's not deleted.

Service Reference:

Examples:

Calling the updateApiKey operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  id: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  expires: 'NUMBER_VALUE'
};
appsync.updateApiKey(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The ID for the GraphQL API.

    • id — (String)

      The API key ID.

    • description — (String)

      A description of the purpose of the API key.

    • expires — (Integer)

      From the update time, the time after which the API key expires. The date is represented as seconds since the epoch. For more information, see .

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • apiKey — (map)

        The API key.

        • id — (String)

          The API key ID.

        • description — (String)

          A description of the purpose of the API key.

        • expires — (Integer)

          The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

        • deletes — (Integer)

          The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDataSource(params = {}, callback) ⇒ AWS.Request

Updates a DataSource object.

Service Reference:

Examples:

Calling the updateDataSource operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  type: AWS_LAMBDA | AMAZON_DYNAMODB | AMAZON_ELASTICSEARCH | NONE | HTTP | RELATIONAL_DATABASE | AMAZON_OPENSEARCH_SERVICE | AMAZON_EVENTBRIDGE, /* required */
  description: 'STRING_VALUE',
  dynamodbConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    tableName: 'STRING_VALUE', /* required */
    deltaSyncConfig: {
      baseTableTTL: 'NUMBER_VALUE',
      deltaSyncTableName: 'STRING_VALUE',
      deltaSyncTableTTL: 'NUMBER_VALUE'
    },
    useCallerCredentials: true || false,
    versioned: true || false
  },
  elasticsearchConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    endpoint: 'STRING_VALUE' /* required */
  },
  eventBridgeConfig: {
    eventBusArn: 'STRING_VALUE' /* required */
  },
  httpConfig: {
    authorizationConfig: {
      authorizationType: AWS_IAM, /* required */
      awsIamConfig: {
        signingRegion: 'STRING_VALUE',
        signingServiceName: 'STRING_VALUE'
      }
    },
    endpoint: 'STRING_VALUE'
  },
  lambdaConfig: {
    lambdaFunctionArn: 'STRING_VALUE' /* required */
  },
  metricsConfig: ENABLED | DISABLED,
  openSearchServiceConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    endpoint: 'STRING_VALUE' /* required */
  },
  relationalDatabaseConfig: {
    rdsHttpEndpointConfig: {
      awsRegion: 'STRING_VALUE',
      awsSecretStoreArn: 'STRING_VALUE',
      databaseName: 'STRING_VALUE',
      dbClusterIdentifier: 'STRING_VALUE',
      schema: 'STRING_VALUE'
    },
    relationalDatabaseSourceType: RDS_HTTP_ENDPOINT
  },
  serviceRoleArn: 'STRING_VALUE'
};
appsync.updateDataSource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • name — (String)

      The new name for the data source.

    • description — (String)

      The new description for the data source.

    • type — (String)

      The new data source type.

      Possible values include:
      • "AWS_LAMBDA"
      • "AMAZON_DYNAMODB"
      • "AMAZON_ELASTICSEARCH"
      • "NONE"
      • "HTTP"
      • "RELATIONAL_DATABASE"
      • "AMAZON_OPENSEARCH_SERVICE"
      • "AMAZON_EVENTBRIDGE"
    • serviceRoleArn — (String)

      The new service role Amazon Resource Name (ARN) for the data source.

    • dynamodbConfig — (map)

      The new Amazon DynamoDB configuration.

      • tableNamerequired — (String)

        The table name.

      • awsRegionrequired — (String)

        The Amazon Web Services Region.

      • useCallerCredentials — (Boolean)

        Set to TRUE to use Amazon Cognito credentials with this data source.

      • deltaSyncConfig — (map)

        The DeltaSyncConfig for a versioned data source.

        • baseTableTTL — (Integer)

          The number of minutes that an Item is stored in the data source.

        • deltaSyncTableName — (String)

          The Delta Sync table name.

        • deltaSyncTableTTL — (Integer)

          The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.

      • versioned — (Boolean)

        Set to TRUE to use Conflict Detection and Resolution with this data source.

    • lambdaConfig — (map)

      The new Lambda configuration.

      • lambdaFunctionArnrequired — (String)

        The Amazon Resource Name (ARN) for the Lambda function.

    • elasticsearchConfig — (map)

      The new OpenSearch configuration.

      As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. Instead, use UpdateDataSourceRequest$openSearchServiceConfig to update an OpenSearch data source.

      • endpointrequired — (String)

        The endpoint.

      • awsRegionrequired — (String)

        The Amazon Web Services Region.

    • openSearchServiceConfig — (map)

      The new OpenSearch configuration.

      • endpointrequired — (String)

        The endpoint.

      • awsRegionrequired — (String)

        The Amazon Web Services Region.

    • httpConfig — (map)

      The new HTTP endpoint configuration.

      • endpoint — (String)

        The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

      • authorizationConfig — (map)

        The authorization configuration in case the HTTP endpoint requires authorization.

        • authorizationTyperequired — (String)

          The authorization type that the HTTP endpoint requires.

          • AWS_IAM: The authorization type is Signature Version 4 (SigV4).

          Possible values include:
          • "AWS_IAM"
        • awsIamConfig — (map)

          The Identity and Access Management (IAM) settings.

          • signingRegion — (String)

            The signing Amazon Web Services Region for IAM authorization.

          • signingServiceName — (String)

            The signing service name for IAM authorization.

    • relationalDatabaseConfig — (map)

      The new relational database configuration.

      • relationalDatabaseSourceType — (String)

        Source type for the relational database.

        • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.

        Possible values include:
        • "RDS_HTTP_ENDPOINT"
      • rdsHttpEndpointConfig — (map)

        Amazon RDS HTTP endpoint settings.

        • awsRegion — (String)

          Amazon Web Services Region for Amazon RDS HTTP endpoint.

        • dbClusterIdentifier — (String)

          Amazon RDS cluster Amazon Resource Name (ARN).

        • databaseName — (String)

          Logical database name.

        • schema — (String)

          Logical schema name.

        • awsSecretStoreArn — (String)

          Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.

    • eventBridgeConfig — (map)

      The new Amazon EventBridge settings.

    • metricsConfig — (String)

      Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

      metricsConfig can be ENABLED or DISABLED.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • dataSource — (map)

        The updated DataSource object.

        • dataSourceArn — (String)

          The data source Amazon Resource Name (ARN).

        • name — (String)

          The name of the data source.

        • description — (String)

          The description of the data source.

        • type — (String)

          The type of the data source.

          • AWS_LAMBDA: The data source is an Lambda function.

          • AMAZON_DYNAMODB: The data source is an Amazon DynamoDB table.

          • AMAZON_ELASTICSEARCH: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_OPENSEARCH_SERVICE: The data source is an Amazon OpenSearch Service domain.

          • AMAZON_EVENTBRIDGE: The data source is an Amazon EventBridge configuration.

          • NONE: There is no data source. Use this type when you want to invoke a GraphQL operation without connecting to a data source, such as when you're performing data transformation with resolvers or invoking a subscription from a mutation.

          • HTTP: The data source is an HTTP endpoint.

          • RELATIONAL_DATABASE: The data source is a relational database.

          Possible values include:
          • "AWS_LAMBDA"
          • "AMAZON_DYNAMODB"
          • "AMAZON_ELASTICSEARCH"
          • "NONE"
          • "HTTP"
          • "RELATIONAL_DATABASE"
          • "AMAZON_OPENSEARCH_SERVICE"
          • "AMAZON_EVENTBRIDGE"
        • serviceRoleArn — (String)

          The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.

        • dynamodbConfig — (map)

          DynamoDB settings.

          • tableNamerequired — (String)

            The table name.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

          • useCallerCredentials — (Boolean)

            Set to TRUE to use Amazon Cognito credentials with this data source.

          • deltaSyncConfig — (map)

            The DeltaSyncConfig for a versioned data source.

            • baseTableTTL — (Integer)

              The number of minutes that an Item is stored in the data source.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.

          • versioned — (Boolean)

            Set to TRUE to use Conflict Detection and Resolution with this data source.

        • lambdaConfig — (map)

          Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The Amazon Resource Name (ARN) for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • openSearchServiceConfig — (map)

          Amazon OpenSearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The Amazon Web Services Region.

        • httpConfig — (map)

          HTTP endpoint settings.

          • endpoint — (String)

            The HTTP URL endpoint. You can specify either the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If you don't specify the port, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization configuration in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type that the HTTP endpoint requires.

              • AWS_IAM: The authorization type is Signature Version 4 (SigV4).

              Possible values include:
              • "AWS_IAM"
            • awsIamConfig — (map)

              The Identity and Access Management (IAM) settings.

              • signingRegion — (String)

                The signing Amazon Web Services Region for IAM authorization.

              • signingServiceName — (String)

                The signing service name for IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon Relational Database Service (Amazon RDS) HTTP endpoint.

            Possible values include:
            • "RDS_HTTP_ENDPOINT"
          • rdsHttpEndpointConfig — (map)

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for Amazon RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster Amazon Resource Name (ARN).

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store Amazon Resource Name (ARN) for database credentials.

        • eventBridgeConfig — (map)

          Amazon EventBridge settings.

        • metricsConfig — (String)

          Enables or disables enhanced data source metrics for specified data sources. Note that metricsConfig won't be used unless the dataSourceLevelMetricsBehavior value is set to PER_DATA_SOURCE_METRICS. If the dataSourceLevelMetricsBehavior is set to FULL_REQUEST_DATA_SOURCE_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDomainName(params = {}, callback) ⇒ AWS.Request

Updates a custom DomainName object.

Service Reference:

Examples:

Calling the updateDomainName operation

var params = {
  domainName: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE'
};
appsync.updateDomainName(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • domainName — (String)

      The domain name.

    • description — (String)

      A description of the DomainName.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • domainNameConfig — (map)

        The configuration for the DomainName.

        • domainName — (String)

          The domain name.

        • description — (String)

          A description of the DomainName configuration.

        • certificateArn — (String)

          The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.

        • appsyncDomainName — (String)

          The domain name that AppSync provides.

        • hostedZoneId — (String)

          The ID of your Amazon Route 53 hosted zone.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateFunction(params = {}, callback) ⇒ AWS.Request

Updates a Function object.

Service Reference:

Examples:

Calling the updateFunction operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  dataSourceName: 'STRING_VALUE', /* required */
  functionId: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  code: 'STRING_VALUE',
  description: 'STRING_VALUE',
  functionVersion: 'STRING_VALUE',
  maxBatchSize: 'NUMBER_VALUE',
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  runtime: {
    name: APPSYNC_JS, /* required */
    runtimeVersion: 'STRING_VALUE' /* required */
  },
  syncConfig: {
    conflictDetection: VERSION | NONE,
    conflictHandler: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE,
    lambdaConflictHandlerConfig: {
      lambdaConflictHandlerArn: 'STRING_VALUE'
    }
  }
};
appsync.updateFunction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The GraphQL API ID.

    • name — (String)

      The Function name.

    • description — (String)

      The Function description.

    • functionId — (String)

      The function ID.

    • dataSourceName — (String)

      The Function DataSource name.

    • requestMappingTemplate — (String)

      The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

    • responseMappingTemplate — (String)

      The Function request mapping template.

    • functionVersion — (String)

      The version of the request mapping template. Currently, the supported value is 2018-05-29. Note that when using VTL and mapping templates, the functionVersion is required.

    • syncConfig — (map)

      Describes a Sync configuration for a resolver.

      Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

      • conflictHandler — (String)

        The Conflict Resolution strategy to perform in the event of a conflict.

        • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

        • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

        • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

        Possible values include:
        • "OPTIMISTIC_CONCURRENCY"
        • "LAMBDA"
        • "AUTOMERGE"
        • "NONE"
      • conflictDetection — (String)

        The Conflict Detection strategy to use.

        • VERSION: Detect conflicts based on object versions for this resolver.

        • NONE: Do not detect conflicts when invoking this resolver.

        Possible values include:
        • "VERSION"
        • "NONE"
      • lambdaConflictHandlerConfig — (map)

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

    • maxBatchSize — (Integer)

      The maximum batching size for a resolver.

    • runtime — (map)

      Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

      • namerequired — (String)

        The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

        Possible values include:
        • "APPSYNC_JS"
      • runtimeVersionrequired — (String)

        The version of the runtime to use. Currently, the only allowed version is 1.0.0.

    • code — (String)

      The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • functionConfiguration — (map)

        The Function object.

        • functionId — (String)

          A unique ID representing the Function object.

        • functionArn — (String)

          The Amazon Resource Name (ARN) of the Function object.

        • name — (String)

          The name of the Function object.

        • description — (String)

          The Function description.

        • dataSourceName — (String)

          The name of the DataSource.

        • requestMappingTemplate — (String)

          The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

        • responseMappingTemplate — (String)

          The Function response mapping template.

        • functionVersion — (String)

          The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.

        • syncConfig — (map)

          Describes a Sync configuration for a resolver.

          Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateGraphqlApi(params = {}, callback) ⇒ AWS.Request

Updates a GraphqlApi object.

Service Reference:

Examples:

Calling the updateGraphqlApi operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  authenticationType: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT | AWS_LAMBDA, /* required */
  name: 'STRING_VALUE', /* required */
  additionalAuthenticationProviders: [
    {
      authenticationType: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT | AWS_LAMBDA,
      lambdaAuthorizerConfig: {
        authorizerUri: 'STRING_VALUE', /* required */
        authorizerResultTtlInSeconds: 'NUMBER_VALUE',
        identityValidationExpression: 'STRING_VALUE'
      },
      openIDConnectConfig: {
        issuer: 'STRING_VALUE', /* required */
        authTTL: 'NUMBER_VALUE',
        clientId: 'STRING_VALUE',
        iatTTL: 'NUMBER_VALUE'
      },
      userPoolConfig: {
        awsRegion: 'STRING_VALUE', /* required */
        userPoolId: 'STRING_VALUE', /* required */
        appIdClientRegex: 'STRING_VALUE'
      }
    },
    /* more items */
  ],
  enhancedMetricsConfig: {
    dataSourceLevelMetricsBehavior: FULL_REQUEST_DATA_SOURCE_METRICS | PER_DATA_SOURCE_METRICS, /* required */
    operationLevelMetricsConfig: ENABLED | DISABLED, /* required */
    resolverLevelMetricsBehavior: FULL_REQUEST_RESOLVER_METRICS | PER_RESOLVER_METRICS /* required */
  },
  introspectionConfig: ENABLED | DISABLED,
  lambdaAuthorizerConfig: {
    authorizerUri: 'STRING_VALUE', /* required */
    authorizerResultTtlInSeconds: 'NUMBER_VALUE',
    identityValidationExpression: 'STRING_VALUE'
  },
  logConfig: {
    cloudWatchLogsRoleArn: 'STRING_VALUE', /* required */
    fieldLogLevel: NONE | ERROR | ALL | INFO | DEBUG, /* required */
    excludeVerboseContent: true || false
  },
  mergedApiExecutionRoleArn: 'STRING_VALUE',
  openIDConnectConfig: {
    issuer: 'STRING_VALUE', /* required */
    authTTL: 'NUMBER_VALUE',
    clientId: 'STRING_VALUE',
    iatTTL: 'NUMBER_VALUE'
  },
  ownerContact: 'STRING_VALUE',
  queryDepthLimit: 'NUMBER_VALUE',
  resolverCountLimit: 'NUMBER_VALUE',
  userPoolConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    defaultAction: ALLOW | DENY, /* required */
    userPoolId: 'STRING_VALUE', /* required */
    appIdClientRegex: 'STRING_VALUE'
  },
  xrayEnabled: true || false
};
appsync.updateGraphqlApi(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • name — (String)

      The new name for the GraphqlApi object.

    • logConfig — (map)

      The Amazon CloudWatch Logs configuration for the GraphqlApi object.

      • fieldLogLevelrequired — (String)

        The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL.

        • NONE: No field-level logs are captured.

        • ERROR: Logs the following information only for the fields that are in the error category:

          • The error section in the server response.

          • Field-level errors.

          • The generated request/response functions that got resolved for error fields.

        • INFO: Logs the following information only for the fields that are in the info and error categories:

          • Info-level messages.

          • The user messages sent through $util.log.info and console.log.

          • Field-level tracing and mapping logs are not shown.

        • DEBUG: Logs the following information only for the fields that are in the debug, info, and error categories:

          • Debug-level messages.

          • The user messages sent through $util.log.info, $util.log.debug, console.log, and console.debug.

          • Field-level tracing and mapping logs are not shown.

        • ALL: The following information is logged for all fields in the query:

          • Field-level tracing information.

          • The generated request/response functions that were resolved for each field.

        Possible values include:
        • "NONE"
        • "ERROR"
        • "ALL"
        • "INFO"
        • "DEBUG"
      • cloudWatchLogsRoleArnrequired — (String)

        The service role that AppSync assumes to publish to CloudWatch logs in your account.

      • excludeVerboseContent — (Boolean)

        Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

    • authenticationType — (String)

      The new authentication type for the GraphqlApi object.

      Possible values include:
      • "API_KEY"
      • "AWS_IAM"
      • "AMAZON_COGNITO_USER_POOLS"
      • "OPENID_CONNECT"
      • "AWS_LAMBDA"
    • userPoolConfig — (map)

      The new Amazon Cognito user pool configuration for the ~GraphqlApi object.

      • userPoolIdrequired — (String)

        The user pool ID.

      • awsRegionrequired — (String)

        The Amazon Web Services Region in which the user pool was created.

      • defaultActionrequired — (String)

        The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.

        Possible values include:
        • "ALLOW"
        • "DENY"
      • appIdClientRegex — (String)

        A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

    • openIDConnectConfig — (map)

      The OpenID Connect configuration for the GraphqlApi object.

      • issuerrequired — (String)

        The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

      • clientId — (String)

        The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

      • iatTTL — (Integer)

        The number of milliseconds that a token is valid after it's issued to a user.

      • authTTL — (Integer)

        The number of milliseconds that a token is valid after being authenticated.

    • additionalAuthenticationProviders — (Array<map>)

      A list of additional authentication providers for the GraphqlApi API.

      • authenticationType — (String)

        The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.

        Possible values include:
        • "API_KEY"
        • "AWS_IAM"
        • "AMAZON_COGNITO_USER_POOLS"
        • "OPENID_CONNECT"
        • "AWS_LAMBDA"
      • openIDConnectConfig — (map)

        The OIDC configuration.

        • issuerrequired — (String)

          The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

        • clientId — (String)

          The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

        • iatTTL — (Integer)

          The number of milliseconds that a token is valid after it's issued to a user.

        • authTTL — (Integer)

          The number of milliseconds that a token is valid after being authenticated.

      • userPoolConfig — (map)

        The Amazon Cognito user pool configuration.

        • userPoolIdrequired — (String)

          The user pool ID.

        • awsRegionrequired — (String)

          The Amazon Web Services Region in which the user pool was created.

        • appIdClientRegex — (String)

          A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

      • lambdaAuthorizerConfig — (map)

        Configuration for Lambda function authorization.

        • authorizerResultTtlInSeconds — (Integer)

          The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

        • authorizerUrirequired — (String)

          The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

          Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

          aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

        • identityValidationExpression — (String)

          A regular expression for validation of tokens before the Lambda function is called.

    • xrayEnabled — (Boolean)

      A flag indicating whether to use X-Ray tracing for the GraphqlApi.

    • lambdaAuthorizerConfig — (map)

      Configuration for Lambda function authorization.

      • authorizerResultTtlInSeconds — (Integer)

        The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

      • authorizerUrirequired — (String)

        The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

        Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

        aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

      • identityValidationExpression — (String)

        A regular expression for validation of tokens before the Lambda function is called.

    • mergedApiExecutionRoleArn — (String)

      The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.

    • ownerContact — (String)

      The owner contact information for an API resource.

      This field accepts any string input with a length of 0 - 256 characters.

    • introspectionConfig — (String)

      Sets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.

      For more information about introspection, see GraphQL introspection.

      Possible values include:
      • "ENABLED"
      • "DISABLED"
    • queryDepthLimit — (Integer)

      The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.

      Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.

    • resolverCountLimit — (Integer)

      The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000. When specified, the limit value can be between 1 and 10000. This field will produce a limit error if the operation falls out of bounds.

    • enhancedMetricsConfig — (map)

      The enhancedMetricsConfig object.

      • resolverLevelMetricsBehaviorrequired — (String)

        Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

        • GraphQL errors: The number of GraphQL errors that occurred.

        • Requests: The number of invocations that occurred during a request.

        • Latency: The time to complete a resolver invocation.

        • Cache hits: The number of cache hits during a request.

        • Cache misses: The number of cache misses during a request.

        These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

        • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

        • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

        Possible values include:
        • "FULL_REQUEST_RESOLVER_METRICS"
        • "PER_RESOLVER_METRICS"
      • dataSourceLevelMetricsBehaviorrequired — (String)

        Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

        • Requests: The number of invocations that occured during a request.

        • Latency: The time to complete a data source invocation.

        • Errors: The number of errors that occurred during a data source invocation.

        These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

        • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

        • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

        Possible values include:
        • "FULL_REQUEST_DATA_SOURCE_METRICS"
        • "PER_DATA_SOURCE_METRICS"
      • operationLevelMetricsConfigrequired — (String)

        Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

        • Requests: The number of times a specified GraphQL operation was called.

        • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

        Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

        Possible values include:
        • "ENABLED"
        • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • graphqlApi — (map)

        The updated GraphqlApi object.

        • name — (String)

          The API name.

        • apiId — (String)

          The API ID.

        • authenticationType — (String)

          The authentication type.

          Possible values include:
          • "API_KEY"
          • "AWS_IAM"
          • "AMAZON_COGNITO_USER_POOLS"
          • "OPENID_CONNECT"
          • "AWS_LAMBDA"
        • logConfig — (map)

          The Amazon CloudWatch Logs configuration.

          • fieldLogLevelrequired — (String)

            The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL.

            • NONE: No field-level logs are captured.

            • ERROR: Logs the following information only for the fields that are in the error category:

              • The error section in the server response.

              • Field-level errors.

              • The generated request/response functions that got resolved for error fields.

            • INFO: Logs the following information only for the fields that are in the info and error categories:

              • Info-level messages.

              • The user messages sent through $util.log.info and console.log.

              • Field-level tracing and mapping logs are not shown.

            • DEBUG: Logs the following information only for the fields that are in the debug, info, and error categories:

              • Debug-level messages.

              • The user messages sent through $util.log.info, $util.log.debug, console.log, and console.debug.

              • Field-level tracing and mapping logs are not shown.

            • ALL: The following information is logged for all fields in the query:

              • Field-level tracing information.

              • The generated request/response functions that were resolved for each field.

            Possible values include:
            • "NONE"
            • "ERROR"
            • "ALL"
            • "INFO"
            • "DEBUG"
          • cloudWatchLogsRoleArnrequired — (String)

            The service role that AppSync assumes to publish to CloudWatch logs in your account.

          • excludeVerboseContent — (Boolean)

            Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

        • userPoolConfig — (map)

          The Amazon Cognito user pool configuration.

          • userPoolIdrequired — (String)

            The user pool ID.

          • awsRegionrequired — (String)

            The Amazon Web Services Region in which the user pool was created.

          • defaultActionrequired — (String)

            The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.

            Possible values include:
            • "ALLOW"
            • "DENY"
          • appIdClientRegex — (String)

            A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

          • clientId — (String)

            The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds that a token is valid after it's issued to a user.

          • authTTL — (Integer)

            The number of milliseconds that a token is valid after being authenticated.

        • arn — (String)

          The Amazon Resource Name (ARN).

        • uris — (map<String>)

          The URIs.

        • tags — (map<String>)

          The tags.

        • additionalAuthenticationProviders — (Array<map>)

          A list of additional authentication providers for the GraphqlApi API.

          • authenticationType — (String)

            The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
            • "AWS_LAMBDA"
          • openIDConnectConfig — (map)

            The OIDC configuration.

            • issuerrequired — (String)

              The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

            • clientId — (String)

              The client identifier of the relying party at the OpenID identity provider. This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You can specify a regular expression so that AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds that a token is valid after it's issued to a user.

            • authTTL — (Integer)

              The number of milliseconds that a token is valid after being authenticated.

          • userPoolConfig — (map)

            The Amazon Cognito user pool configuration.

            • userPoolIdrequired — (String)

              The user pool ID.

            • awsRegionrequired — (String)

              The Amazon Web Services Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.

          • lambdaAuthorizerConfig — (map)

            Configuration for Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

            • authorizerUrirequired — (String)

              The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

              Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

              aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

            • identityValidationExpression — (String)

              A regular expression for validation of tokens before the Lambda function is called.

        • xrayEnabled — (Boolean)

          A flag indicating whether to use X-Ray tracing for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

          • authorizerUrirequired — (String)

            The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN (.../v3), or an alias ARN.

            Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the Command Line Interface (CLI), run the following:

            aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

          • identityValidationExpression — (String)

            A regular expression for validation of tokens before the Lambda function is called.

        • dns — (map<String>)

          The DNS records for the API.

        • visibility — (String)

          Sets the value of the GraphQL API to public (GLOBAL) or private (PRIVATE). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created.

          Possible values include:
          • "GLOBAL"
          • "PRIVATE"
        • apiType — (String)

          The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED).

          Possible values include:
          • "GRAPHQL"
          • "MERGED"
        • mergedApiExecutionRoleArn — (String)

          The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.

        • owner — (String)

          The account owner of the GraphQL API.

        • ownerContact — (String)

          The owner contact information for an API resource.

          This field accepts any string input with a length of 0 - 256 characters.

        • introspectionConfig — (String)

          Sets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.

          For more information about introspection, see GraphQL introspection.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • queryDepthLimit — (Integer)

          The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds.

          Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.

        • resolverCountLimit — (Integer)

          The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000. When specified, the limit value can be between 1 and 10000. This field will produce a limit error if the operation falls out of bounds.

        • enhancedMetricsConfig — (map)

          The enhancedMetricsConfig object.

          • resolverLevelMetricsBehaviorrequired — (String)

            Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

            • GraphQL errors: The number of GraphQL errors that occurred.

            • Requests: The number of invocations that occurred during a request.

            • Latency: The time to complete a resolver invocation.

            • Cache hits: The number of cache hits during a request.

            • Cache misses: The number of cache misses during a request.

            These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

            • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_RESOLVER_METRICS"
            • "PER_RESOLVER_METRICS"
          • dataSourceLevelMetricsBehaviorrequired — (String)

            Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

            • Requests: The number of invocations that occured during a request.

            • Latency: The time to complete a data source invocation.

            • Errors: The number of errors that occurred during a data source invocation.

            These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

            • FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request.

            • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED.

            Possible values include:
            • "FULL_REQUEST_DATA_SOURCE_METRICS"
            • "PER_DATA_SOURCE_METRICS"
          • operationLevelMetricsConfigrequired — (String)

            Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

            • Requests: The number of times a specified GraphQL operation was called.

            • GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation.

            Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.

            Possible values include:
            • "ENABLED"
            • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateResolver(params = {}, callback) ⇒ AWS.Request

Updates a Resolver object.

Service Reference:

Examples:

Calling the updateResolver operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  fieldName: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE', /* required */
  cachingConfig: {
    ttl: 'NUMBER_VALUE', /* required */
    cachingKeys: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  code: 'STRING_VALUE',
  dataSourceName: 'STRING_VALUE',
  kind: UNIT | PIPELINE,
  maxBatchSize: 'NUMBER_VALUE',
  metricsConfig: ENABLED | DISABLED,
  pipelineConfig: {
    functions: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  runtime: {
    name: APPSYNC_JS, /* required */
    runtimeVersion: 'STRING_VALUE' /* required */
  },
  syncConfig: {
    conflictDetection: VERSION | NONE,
    conflictHandler: OPTIMISTIC_CONCURRENCY | LAMBDA | AUTOMERGE | NONE,
    lambdaConflictHandlerConfig: {
      lambdaConflictHandlerArn: 'STRING_VALUE'
    }
  }
};
appsync.updateResolver(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • typeName — (String)

      The new type name.

    • fieldName — (String)

      The new field name.

    • dataSourceName — (String)

      The new data source name.

    • requestMappingTemplate — (String)

      The new request mapping template.

      A resolver uses a request mapping template to convert a GraphQL expression into a format that a data source can understand. Mapping templates are written in Apache Velocity Template Language (VTL).

      VTL request mapping templates are optional when using an Lambda data source. For all other data sources, VTL request and response mapping templates are required.

    • responseMappingTemplate — (String)

      The new response mapping template.

    • kind — (String)

      The resolver type.

      • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.

      • PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.

      Possible values include:
      • "UNIT"
      • "PIPELINE"
    • pipelineConfig — (map)

      The PipelineConfig.

      • functions — (Array<String>)

        A list of Function objects.

    • syncConfig — (map)

      The SyncConfig for a resolver attached to a versioned data source.

      • conflictHandler — (String)

        The Conflict Resolution strategy to perform in the event of a conflict.

        • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

        • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

        • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

        Possible values include:
        • "OPTIMISTIC_CONCURRENCY"
        • "LAMBDA"
        • "AUTOMERGE"
        • "NONE"
      • conflictDetection — (String)

        The Conflict Detection strategy to use.

        • VERSION: Detect conflicts based on object versions for this resolver.

        • NONE: Do not detect conflicts when invoking this resolver.

        Possible values include:
        • "VERSION"
        • "NONE"
      • lambdaConflictHandlerConfig — (map)

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

    • cachingConfig — (map)

      The caching configuration for the resolver.

      • ttlrequired — (Integer)

        The TTL in seconds for a resolver that has caching activated.

        Valid values are 1–3,600 seconds.

      • cachingKeys — (Array<String>)

        The caching keys for a resolver that has caching activated.

        Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

    • maxBatchSize — (Integer)

      The maximum batching size for a resolver.

    • runtime — (map)

      Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

      • namerequired — (String)

        The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

        Possible values include:
        • "APPSYNC_JS"
      • runtimeVersionrequired — (String)

        The version of the runtime to use. Currently, the only allowed version is 1.0.0.

    • code — (String)

      The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

    • metricsConfig — (String)

      Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS. If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

      metricsConfig can be ENABLED or DISABLED.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • resolver — (map)

        The updated Resolver object.

        • typeName — (String)

          The resolver type name.

        • fieldName — (String)

          The resolver field name.

        • dataSourceName — (String)

          The resolver data source name.

        • resolverArn — (String)

          The resolver Amazon Resource Name (ARN).

        • requestMappingTemplate — (String)

          The request mapping template.

        • responseMappingTemplate — (String)

          The response mapping template.

        • kind — (String)

          The resolver type.

          • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.

          Possible values include:
          • "UNIT"
          • "PIPELINE"
        • pipelineConfig — (map)

          The PipelineConfig.

          • functions — (Array<String>)

            A list of Function objects.

        • syncConfig — (map)

          The SyncConfig for a resolver attached to a versioned data source.

          • conflictHandler — (String)

            The Conflict Resolution strategy to perform in the event of a conflict.

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.

            • AUTOMERGE: Resolve conflicts with the Automerge conflict resolution strategy.

            • LAMBDA: Resolve conflicts with an Lambda function supplied in the LambdaConflictHandlerConfig.

            Possible values include:
            • "OPTIMISTIC_CONCURRENCY"
            • "LAMBDA"
            • "AUTOMERGE"
            • "NONE"
          • conflictDetection — (String)

            The Conflict Detection strategy to use.

            • VERSION: Detect conflicts based on object versions for this resolver.

            • NONE: Do not detect conflicts when invoking this resolver.

            Possible values include:
            • "VERSION"
            • "NONE"
          • lambdaConflictHandlerConfig — (map)

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttlrequired — (Integer)

            The TTL in seconds for a resolver that has caching activated.

            Valid values are 1–3,600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching activated.

            Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

        • maxBatchSize — (Integer)

          The maximum batching size for a resolver.

        • runtime — (map)

          Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

          • namerequired — (String)

            The name of the runtime to use. Currently, the only allowed value is APPSYNC_JS.

            Possible values include:
            • "APPSYNC_JS"
          • runtimeVersionrequired — (String)

            The version of the runtime to use. Currently, the only allowed version is 1.0.0.

        • code — (String)

          The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.

        • metricsConfig — (String)

          Enables or disables enhanced resolver metrics for specified resolvers. Note that metricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS. If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, metricsConfig will be ignored. However, you can still set its value.

          metricsConfig can be ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateSourceApiAssociation(params = {}, callback) ⇒ AWS.Request

Updates some of the configuration choices of a particular source API association.

Service Reference:

Examples:

Calling the updateSourceApiAssociation operation

var params = {
  associationId: 'STRING_VALUE', /* required */
  mergedApiIdentifier: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  sourceApiAssociationConfig: {
    mergeType: MANUAL_MERGE | AUTO_MERGE
  }
};
appsync.updateSourceApiAssociation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • associationId — (String)

      The ID generated by the AppSync service for the source API association.

    • mergedApiIdentifier — (String)

      The identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.

    • description — (String)

      The description field.

    • sourceApiAssociationConfig — (map)

      The SourceApiAssociationConfig object data.

      • mergeType — (String)

        The property that indicates which merging option is enabled in the source API association.

        Valid merge types are MANUAL_MERGE (default) and AUTO_MERGE. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use MergedApiExecutionRoleArn to perform merge operations.

        Possible values include:
        • "MANUAL_MERGE"
        • "AUTO_MERGE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceApiAssociation — (map)

        The SourceApiAssociation object data.

        • associationId — (String)

          The ID generated by the AppSync service for the source API association.

        • associationArn — (String)

          The Amazon Resource Name (ARN) of the source API association.

        • sourceApiId — (String)

          The ID of the AppSync source API.

        • sourceApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync source API.

        • mergedApiArn — (String)

          The Amazon Resource Name (ARN) of the AppSync Merged API.

        • mergedApiId — (String)

          The ID of the AppSync Merged API.

        • description — (String)

          The description field.

        • sourceApiAssociationConfig — (map)

          The SourceApiAssociationConfig object data.

          • mergeType — (String)

            The property that indicates which merging option is enabled in the source API association.

            Valid merge types are MANUAL_MERGE (default) and AUTO_MERGE. Manual merges are the default behavior and require the user to trigger any changes from the source APIs to the merged API manually. Auto merges subscribe the merged API to the changes performed on the source APIs so that any change in the source APIs are also made to the merged API. Auto merges use MergedApiExecutionRoleArn to perform merge operations.

            Possible values include:
            • "MANUAL_MERGE"
            • "AUTO_MERGE"
        • sourceApiAssociationStatus — (String)

          The state of the source API association.

          Possible values include:
          • "MERGE_SCHEDULED"
          • "MERGE_FAILED"
          • "MERGE_SUCCESS"
          • "MERGE_IN_PROGRESS"
          • "AUTO_MERGE_SCHEDULE_FAILED"
          • "DELETION_SCHEDULED"
          • "DELETION_IN_PROGRESS"
          • "DELETION_FAILED"
        • sourceApiAssociationStatusDetail — (String)

          The detailed message related to the current state of the source API association.

        • lastSuccessfulMergeDate — (Date)

          The datetime value of the last successful merge of the source API association. The result will be in UTC format and your local time zone.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateType(params = {}, callback) ⇒ AWS.Request

Updates a Type object.

Service Reference:

Examples:

Calling the updateType operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  format: SDL | JSON, /* required */
  typeName: 'STRING_VALUE', /* required */
  definition: 'STRING_VALUE'
};
appsync.updateType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • apiId — (String)

      The API ID.

    • typeName — (String)

      The new type name.

    • definition — (String)

      The new definition.

    • format — (String)

      The new type format: SDL or JSON.

      Possible values include:
      • "SDL"
      • "JSON"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • type — (map)

        The updated Type object.

        • name — (String)

          The type name.

        • description — (String)

          The type description.

        • arn — (String)

          The type Amazon Resource Name (ARN).

        • definition — (String)

          The type definition.

        • format — (String)

          The type format: SDL or JSON.

          Possible values include:
          • "SDL"
          • "JSON"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.