You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

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.createApiCache(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'.

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

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,
  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 between 1 and 3600 seconds.

    • transitEncryptionEnabled — (Boolean)

      Transit encryption flag when connecting to cache. This setting cannot be updated after creation.

    • atRestEncryptionEnabled — (Boolean)

      At rest encryption flag for cache. This setting cannot be updated 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"

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 between 1 and 3600 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. This setting cannot be updated after creation.

        • atRestEncryptionEnabled — (Boolean)

          At rest encryption flag for cache. This setting cannot be updated 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"

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 are executing 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)

      The time from creation 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, /* 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 */
  },
  httpConfig: {
    authorizationConfig: {
      authorizationType: AWS_IAM, /* required */
      awsIamConfig: {
        signingRegion: 'STRING_VALUE',
        signingServiceName: 'STRING_VALUE'
      }
    },
    endpoint: 'STRING_VALUE'
  },
  lambdaConfig: {
    lambdaFunctionArn: 'STRING_VALUE' /* required */
  },
  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"
    • serviceRoleArn — (String)

      The Identity and Access Management service role 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 datasource.

        • baseTableTTL — (Integer)

          The number of minutes an Item is stored in the datasource.

        • deltaSyncTableName — (String)

          The Delta Sync table name.

        • deltaSyncTableTTL — (Integer)

          The number of minutes 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)

      Amazon Web Services Lambda settings.

      • lambdaFunctionArnrequired — (String)

        The 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 either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

      • authorizationConfig — (map)

        The authorization config in case the HTTP endpoint requires authorization.

        • authorizationTyperequired — (String)

          The authorization type required by the HTTP endpoint.

          • AWS_IAM: The authorization type is Sigv4.

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

          The Identity and Access Management settings.

          • signingRegion — (String)

            The signing region for Identity and Access Management authorization.

          • signingServiceName — (String)

            The signing service name for Identity and Access Management 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 RDS HTTP endpoint.

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

        Amazon RDS HTTP endpoint settings.

        • awsRegion — (String)

          Amazon Web Services Region for RDS HTTP endpoint.

        • dbClusterIdentifier — (String)

          Amazon RDS cluster ARN.

        • databaseName — (String)

          Logical database name.

        • schema — (String)

          Logical schema name.

        • awsSecretStoreArn — (String)

          Amazon Web Services secret store ARN for database credentials.

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 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 Amazon Web Services 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.

          • NONE: There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked 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"
        • serviceRoleArn — (String)

          The Identity and Access Management service role 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 datasource.

            • baseTableTTL — (Integer)

              The number of minutes an Item is stored in the datasource.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes 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)

          Amazon Web Services Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The 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 either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization config in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type required by the HTTP endpoint.

              • AWS_IAM: The authorization type is Sigv4.

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

              The Identity and Access Management settings.

              • signingRegion — (String)

                The signing region for Identity and Access Management authorization.

              • signingServiceName — (String)

                The signing service name for Identity and Access Management 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 RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster ARN.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store ARN for database credentials.

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. Multiple functions can be used to compose the resolver logic.

Service Reference:

Examples:

Calling the createFunction operation

var params = {
  apiId: 'STRING_VALUE', /* required */
  dataSourceName: 'STRING_VALUE', /* required */
  functionVersion: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  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.

    • syncConfig — (map)

      Describes a Sync configuration for a resolver.

      Contains information on which Conflict Detection as well as Resolution strategy should be performed 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 do not match the latest version at the server.

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

        • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Arn for the Lambda function to use as the Conflict Handler.

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 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.

          Contains information on which Conflict Detection as well as Resolution strategy should be performed 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 do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

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 */
  ],
  lambdaAuthorizerConfig: {
    authorizerUri: 'STRING_VALUE', /* required */
    authorizerResultTtlInSeconds: 'NUMBER_VALUE',
    identityValidationExpression: 'STRING_VALUE'
  },
  logConfig: {
    cloudWatchLogsRoleArn: 'STRING_VALUE', /* required */
    fieldLogLevel: NONE | ERROR | ALL, /* required */
    excludeVerboseContent: true || false
  },
  openIDConnectConfig: {
    issuer: 'STRING_VALUE', /* required */
    authTTL: 'NUMBER_VALUE',
    clientId: 'STRING_VALUE',
    iatTTL: 'NUMBER_VALUE'
  },
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  },
  userPoolConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    defaultAction: ALLOW | DENY, /* required */
    userPoolId: 'STRING_VALUE', /* required */
    appIdClientRegex: 'STRING_VALUE'
  },
  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, or ALL.

        • NONE: No field-level logs are captured.

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

          • The error section in the server response.

          • Field-level errors.

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

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

          • Field-level tracing information.

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

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

        The service role that AppSync will assume to publish to Amazon 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, OIDC, Amazon Cognito user pools, or Amazon Web Services 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.

    • openIDConnectConfig — (map)

      The OpenID Connect configuration.

      • issuerrequired — (String)

        The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

      • iatTTL — (Integer)

        The number of milliseconds a token is valid after being issued to a user.

      • authTTL — (Integer)

        The number of milliseconds 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, OIDC, Amazon Cognito user pools, or Amazon Web Services Lambda.

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

        The OpenID Connect configuration.

        • issuerrequired — (String)

          The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

        • iatTTL — (Integer)

          The number of milliseconds a token is valid after being issued to a user.

        • authTTL — (Integer)

          The number of milliseconds 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.

      • lambdaAuthorizerConfig — (map)

        Configuration for Amazon Web Services Lambda function authorization.

        • authorizerResultTtlInSeconds — (Integer)

          The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

        • authorizerUrirequired — (String)

          The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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 enable X-Ray tracing for the GraphqlApi.

    • lambdaAuthorizerConfig — (map)

      Configuration for Amazon Web Services Lambda function authorization.

      • authorizerResultTtlInSeconds — (Integer)

        The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

      • authorizerUrirequired — (String)

        The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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.

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, or ALL.

            • NONE: No field-level logs are captured.

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

              • The error section in the server response.

              • Field-level errors.

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

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

              • Field-level tracing information.

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

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

            The service role that AppSync will assume to publish to Amazon 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.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds a token is valid after being issued to a user.

          • authTTL — (Integer)

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

        • arn — (String)

          The 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, OIDC, Amazon Cognito user pools, or Amazon Web Services Lambda.

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

            The OpenID Connect configuration.

            • issuerrequired — (String)

              The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds a token is valid after being issued to a user.

            • authTTL — (Integer)

              The number of milliseconds 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.

          • lambdaAuthorizerConfig — (map)

            Configuration for Amazon Web Services Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

            • authorizerUrirequired — (String)

              The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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 representing whether X-Ray tracing is enabled for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF ACL associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Amazon Web Services Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

          • authorizerUrirequired — (String)

            The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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.

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: {
    cachingKeys: [
      'STRING_VALUE',
      /* more items */
    ],
    ttl: 'NUMBER_VALUE'
  },
  dataSourceName: 'STRING_VALUE',
  kind: UNIT | PIPELINE,
  pipelineConfig: {
    functions: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  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 be used 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 a Lambda data source. For all other data sources, VTL request and response mapping templates are required.

    • responseMappingTemplate — (String)

      The mapping template to be used for responses from the data source.

    • kind — (String)

      The resolver type.

      • UNIT: A UNIT resolver type. A UNIT resolver is the default resolver type. A UNIT resolver enables you to execute a GraphQL query against a single data source.

      • PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables you to execute a series of Function in a serial manner. You can use a pipeline resolver to execute 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 datasource.

      • conflictHandler — (String)

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

        • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

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

        • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Arn for the Lambda function to use as the Conflict Handler.

    • cachingConfig — (map)

      The caching configuration for the resolver.

      • ttl — (Integer)

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

        Valid values are between 1 and 3600 seconds.

      • cachingKeys — (Array<String>)

        The caching keys for a resolver that has caching enabled.

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

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 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. A UNIT resolver enables you to execute a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables you to execute a series of Function in a serial manner. You can use a pipeline resolver to execute 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 datasource.

          • conflictHandler — (String)

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

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttl — (Integer)

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

            Valid values are between 1 and 3600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching enabled.

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

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 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.

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.

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.

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 between 1 and 3600 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. This setting cannot be updated after creation.

        • atRestEncryptionEnabled — (Boolean)

          At rest encryption flag for cache. This setting cannot be updated 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"

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 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 Amazon Web Services 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.

          • NONE: There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked 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"
        • serviceRoleArn — (String)

          The Identity and Access Management service role 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 datasource.

            • baseTableTTL — (Integer)

              The number of minutes an Item is stored in the datasource.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes 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)

          Amazon Web Services Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The 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 either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization config in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type required by the HTTP endpoint.

              • AWS_IAM: The authorization type is Sigv4.

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

              The Identity and Access Management settings.

              • signingRegion — (String)

                The signing region for Identity and Access Management authorization.

              • signingServiceName — (String)

                The signing service name for Identity and Access Management 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 RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster ARN.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store ARN for database credentials.

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 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.

          Contains information on which Conflict Detection as well as Resolution strategy should be performed 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 do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

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, or ALL.

            • NONE: No field-level logs are captured.

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

              • The error section in the server response.

              • Field-level errors.

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

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

              • Field-level tracing information.

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

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

            The service role that AppSync will assume to publish to Amazon 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.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds a token is valid after being issued to a user.

          • authTTL — (Integer)

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

        • arn — (String)

          The 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, OIDC, Amazon Cognito user pools, or Amazon Web Services Lambda.

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

            The OpenID Connect configuration.

            • issuerrequired — (String)

              The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds a token is valid after being issued to a user.

            • authTTL — (Integer)

              The number of milliseconds 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.

          • lambdaAuthorizerConfig — (map)

            Configuration for Amazon Web Services Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

            • authorizerUrirequired — (String)

              The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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 representing whether X-Ray tracing is enabled for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF ACL associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Amazon Web Services Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

          • authorizerUrirequired — (String)

            The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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.

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 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. A UNIT resolver enables you to execute a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables you to execute a series of Function in a serial manner. You can use a pipeline resolver to execute 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 datasource.

          • conflictHandler — (String)

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

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttl — (Integer)

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

            Valid values are between 1 and 3600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching enabled.

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

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.

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 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 can be used to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results 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 be passed 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 can be used to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results 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 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 Amazon Web Services 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.

          • NONE: There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked 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"
        • serviceRoleArn — (String)

          The Identity and Access Management service role 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 datasource.

            • baseTableTTL — (Integer)

              The number of minutes an Item is stored in the datasource.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes 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)

          Amazon Web Services Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The 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 either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization config in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type required by the HTTP endpoint.

              • AWS_IAM: The authorization type is Sigv4.

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

              The Identity and Access Management settings.

              • signingRegion — (String)

                The signing region for Identity and Access Management authorization.

              • signingServiceName — (String)

                The signing service name for Identity and Access Management 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 RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster ARN.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store ARN for database credentials.

      • nextToken — (String)

        An identifier to be passed 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.

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 can be used to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results 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 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.

          Contains information on which Conflict Detection as well as Resolution strategy should be performed 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 do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

      • nextToken — (String)

        An identifier that was returned from the previous call to this operation, which can be used 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 = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
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 can be used to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results 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:

      • 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, or ALL.

            • NONE: No field-level logs are captured.

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

              • The error section in the server response.

              • Field-level errors.

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

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

              • Field-level tracing information.

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

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

            The service role that AppSync will assume to publish to Amazon 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.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds a token is valid after being issued to a user.

          • authTTL — (Integer)

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

        • arn — (String)

          The 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, OIDC, Amazon Cognito user pools, or Amazon Web Services Lambda.

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

            The OpenID Connect configuration.

            • issuerrequired — (String)

              The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds a token is valid after being issued to a user.

            • authTTL — (Integer)

              The number of milliseconds 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.

          • lambdaAuthorizerConfig — (map)

            Configuration for Amazon Web Services Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

            • authorizerUrirequired — (String)

              The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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 representing whether X-Ray tracing is enabled for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF ACL associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Amazon Web Services Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

          • authorizerUrirequired — (String)

            The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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.

      • nextToken — (String)

        An identifier to be passed 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 can be used to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results 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 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. A UNIT resolver enables you to execute a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables you to execute a series of Function in a serial manner. You can use a pipeline resolver to execute 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 datasource.

          • conflictHandler — (String)

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

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttl — (Integer)

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

            Valid values are between 1 and 3600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching enabled.

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

      • nextToken — (String)

        An identifier to be passed 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 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 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. A UNIT resolver enables you to execute a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables you to execute a series of Function in a serial manner. You can use a pipeline resolver to execute 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 datasource.

          • conflictHandler — (String)

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

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttl — (Integer)

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

            Valid values are between 1 and 3600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching enabled.

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

      • nextToken — (String)

        An identifier that can be used 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 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 can be used to return the next set of items in the list.

    • maxResults — (Integer)

      The maximum number of results 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 ARN.

        • definition — (String)

          The type definition.

        • format — (String)

          The type format: SDL or JSON.

          Possible values include:
          • "SDL"
          • "JSON"
      • nextToken — (String)

        An identifier to be passed 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.

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.

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 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 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 */
};
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 between 1 and 3600 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"

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 between 1 and 3600 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. This setting cannot be updated after creation.

        • atRestEncryptionEnabled — (Boolean)

          At rest encryption flag for cache. This setting cannot be updated 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"

Returns:

  • (AWS.Request)

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

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

Updates an API key. The key can be updated while it is 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)

      The time from update 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, /* 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 */
  },
  httpConfig: {
    authorizationConfig: {
      authorizationType: AWS_IAM, /* required */
      awsIamConfig: {
        signingRegion: 'STRING_VALUE',
        signingServiceName: 'STRING_VALUE'
      }
    },
    endpoint: 'STRING_VALUE'
  },
  lambdaConfig: {
    lambdaFunctionArn: 'STRING_VALUE' /* required */
  },
  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"
    • serviceRoleArn — (String)

      The new service role 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 datasource.

        • baseTableTTL — (Integer)

          The number of minutes an Item is stored in the datasource.

        • deltaSyncTableName — (String)

          The Delta Sync table name.

        • deltaSyncTableTTL — (Integer)

          The number of minutes 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 Amazon Web Services Lambda configuration.

      • lambdaFunctionArnrequired — (String)

        The 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 either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

      • authorizationConfig — (map)

        The authorization config in case the HTTP endpoint requires authorization.

        • authorizationTyperequired — (String)

          The authorization type required by the HTTP endpoint.

          • AWS_IAM: The authorization type is Sigv4.

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

          The Identity and Access Management settings.

          • signingRegion — (String)

            The signing region for Identity and Access Management authorization.

          • signingServiceName — (String)

            The signing service name for Identity and Access Management 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 RDS HTTP endpoint.

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

        Amazon RDS HTTP endpoint settings.

        • awsRegion — (String)

          Amazon Web Services Region for RDS HTTP endpoint.

        • dbClusterIdentifier — (String)

          Amazon RDS cluster ARN.

        • databaseName — (String)

          Logical database name.

        • schema — (String)

          Logical schema name.

        • awsSecretStoreArn — (String)

          Amazon Web Services secret store ARN for database credentials.

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 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 Amazon Web Services 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.

          • NONE: There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked 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"
        • serviceRoleArn — (String)

          The Identity and Access Management service role 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 datasource.

            • baseTableTTL — (Integer)

              The number of minutes an Item is stored in the datasource.

            • deltaSyncTableName — (String)

              The Delta Sync table name.

            • deltaSyncTableTTL — (Integer)

              The number of minutes 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)

          Amazon Web Services Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The 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 either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.

          • authorizationConfig — (map)

            The authorization config in case the HTTP endpoint requires authorization.

            • authorizationTyperequired — (String)

              The authorization type required by the HTTP endpoint.

              • AWS_IAM: The authorization type is Sigv4.

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

              The Identity and Access Management settings.

              • signingRegion — (String)

                The signing region for Identity and Access Management authorization.

              • signingServiceName — (String)

                The signing service name for Identity and Access Management 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 RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              Amazon Web Services Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster ARN.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

              Amazon Web Services secret store ARN for database credentials.

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 */
  functionVersion: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE',
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  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.

    • syncConfig — (map)

      Describes a Sync configuration for a resolver.

      Contains information on which Conflict Detection as well as Resolution strategy should be performed 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 do not match the latest version at the server.

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

        • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Arn for the Lambda function to use as the Conflict Handler.

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 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.

          Contains information on which Conflict Detection as well as Resolution strategy should be performed 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 do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

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 */
  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 */
  ],
  authenticationType: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT | AWS_LAMBDA,
  lambdaAuthorizerConfig: {
    authorizerUri: 'STRING_VALUE', /* required */
    authorizerResultTtlInSeconds: 'NUMBER_VALUE',
    identityValidationExpression: 'STRING_VALUE'
  },
  logConfig: {
    cloudWatchLogsRoleArn: 'STRING_VALUE', /* required */
    fieldLogLevel: NONE | ERROR | ALL, /* required */
    excludeVerboseContent: true || false
  },
  openIDConnectConfig: {
    issuer: 'STRING_VALUE', /* required */
    authTTL: 'NUMBER_VALUE',
    clientId: 'STRING_VALUE',
    iatTTL: '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, or ALL.

        • NONE: No field-level logs are captured.

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

          • The error section in the server response.

          • Field-level errors.

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

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

          • Field-level tracing information.

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

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

        The service role that AppSync will assume to publish to Amazon 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.

    • openIDConnectConfig — (map)

      The OpenID Connect configuration for the GraphqlApi object.

      • issuerrequired — (String)

        The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

      • iatTTL — (Integer)

        The number of milliseconds a token is valid after being issued to a user.

      • authTTL — (Integer)

        The number of milliseconds 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, OIDC, Amazon Cognito user pools, or Amazon Web Services Lambda.

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

        The OpenID Connect configuration.

        • issuerrequired — (String)

          The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

        • iatTTL — (Integer)

          The number of milliseconds a token is valid after being issued to a user.

        • authTTL — (Integer)

          The number of milliseconds 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.

      • lambdaAuthorizerConfig — (map)

        Configuration for Amazon Web Services Lambda function authorization.

        • authorizerResultTtlInSeconds — (Integer)

          The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

        • authorizerUrirequired — (String)

          The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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 enable X-Ray tracing for the GraphqlApi.

    • lambdaAuthorizerConfig — (map)

      Configuration for Amazon Web Services Lambda function authorization.

      • authorizerResultTtlInSeconds — (Integer)

        The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

      • authorizerUrirequired — (String)

        The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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.

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, or ALL.

            • NONE: No field-level logs are captured.

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

              • The error section in the server response.

              • Field-level errors.

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

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

              • Field-level tracing information.

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

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

            The service role that AppSync will assume to publish to Amazon 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.

        • openIDConnectConfig — (map)

          The OpenID Connect configuration.

          • issuerrequired — (String)

            The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

          • iatTTL — (Integer)

            The number of milliseconds a token is valid after being issued to a user.

          • authTTL — (Integer)

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

        • arn — (String)

          The 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, OIDC, Amazon Cognito user pools, or Amazon Web Services Lambda.

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

            The OpenID Connect configuration.

            • issuerrequired — (String)

              The issuer for the OpenID Connect 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 the AppSync can validate against multiple client identifiers at a time.

            • iatTTL — (Integer)

              The number of milliseconds a token is valid after being issued to a user.

            • authTTL — (Integer)

              The number of milliseconds 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.

          • lambdaAuthorizerConfig — (map)

            Configuration for Amazon Web Services Lambda function authorization.

            • authorizerResultTtlInSeconds — (Integer)

              The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

            • authorizerUrirequired — (String)

              The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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 representing whether X-Ray tracing is enabled for this GraphqlApi.

        • wafWebAclArn — (String)

          The ARN of the WAF ACL associated with this GraphqlApi, if one exists.

        • lambdaAuthorizerConfig — (map)

          Configuration for Amazon Web Services Lambda function authorization.

          • authorizerResultTtlInSeconds — (Integer)

            The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a ttlOverride key in its response. A value of 0 disables caching of responses.

          • authorizerUrirequired — (String)

            The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (.../v3) or 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 do so with the Amazon Web Services 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.

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: {
    cachingKeys: [
      'STRING_VALUE',
      /* more items */
    ],
    ttl: 'NUMBER_VALUE'
  },
  dataSourceName: 'STRING_VALUE',
  kind: UNIT | PIPELINE,
  pipelineConfig: {
    functions: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  requestMappingTemplate: 'STRING_VALUE',
  responseMappingTemplate: 'STRING_VALUE',
  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 a 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. A UNIT resolver enables you to execute a GraphQL query against a single data source.

      • PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables you to execute a series of Function in a serial manner. You can use a pipeline resolver to execute 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 datasource.

      • conflictHandler — (String)

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

        • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

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

        • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

        The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

        • lambdaConflictHandlerArn — (String)

          The Arn for the Lambda function to use as the Conflict Handler.

    • cachingConfig — (map)

      The caching configuration for the resolver.

      • ttl — (Integer)

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

        Valid values are between 1 and 3600 seconds.

      • cachingKeys — (Array<String>)

        The caching keys for a resolver that has caching enabled.

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

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 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. A UNIT resolver enables you to execute a GraphQL query against a single data source.

          • PIPELINE: A PIPELINE resolver type. A PIPELINE resolver enables you to execute a series of Function in a serial manner. You can use a pipeline resolver to execute 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 datasource.

          • conflictHandler — (String)

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

            • OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when versions do not match the latest version at the server.

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

            • LAMBDA: Resolve conflicts with a 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 executing this resolver.

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

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn — (String)

              The Arn for the Lambda function to use as the Conflict Handler.

        • cachingConfig — (map)

          The caching configuration for the resolver.

          • ttl — (Integer)

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

            Valid values are between 1 and 3600 seconds.

          • cachingKeys — (Array<String>)

            The caching keys for a resolver that has caching enabled.

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

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 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.