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

AWS 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.createApiKey(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)

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

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

  • 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 returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • 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)

    whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'

  • 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

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.

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, /* required */
  description: 'STRING_VALUE',
  dynamodbConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    tableName: 'STRING_VALUE', /* required */
    useCallerCredentials: 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 */
  },
  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"
    • serviceRoleArn — (String)

      The AWS IAM 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 AWS Region.

      • useCallerCredentials — (Boolean)

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

    • lambdaConfig — (map)

      AWS Lambda settings.

      • lambdaFunctionArnrequired — (String)

        The ARN for the Lambda function.

    • elasticsearchConfig — (map)

      Amazon Elasticsearch Service settings.

      • endpointrequired — (String)

        The endpoint.

      • awsRegionrequired — (String)

        The AWS 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, AWS 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 AWS IAM settings.

          • signingRegion — (String)

            The signing region for AWS IAM authorization.

          • signingServiceName — (String)

            The signing service name for AWS IAM authorization.

    • relationalDatabaseConfig — (map)

      Relational database settings.

      • relationalDatabaseSourceType — (String)

        Source type for the relational database.

        • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon RDS HTTP endpoint.

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

        Amazon RDS HTTP endpoint settings.

        • awsRegion — (String)

          AWS Region for RDS HTTP endpoint.

        • dbClusterIdentifier — (String)

          Amazon RDS cluster identifier.

        • databaseName — (String)

          Logical database name.

        • schema — (String)

          Logical schema name.

        • awsSecretStoreArn — (String)

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

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

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

          • AWS_LAMBDA: The data source is an AWS Lambda function.

          • 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"
        • serviceRoleArn — (String)

          The AWS IAM 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 AWS Region.

          • useCallerCredentials — (Boolean)

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

        • lambdaConfig — (map)

          AWS Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The ARN for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon Elasticsearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The AWS 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, AWS 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 AWS IAM settings.

              • signingRegion — (String)

                The signing region for AWS IAM authorization.

              • signingServiceName — (String)

                The signing service name for AWS IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              AWS Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster identifier.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

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

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.

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, /* required */
  name: 'STRING_VALUE', /* required */
  additionalAuthenticationProviders: [
    {
      authenticationType: API_KEY | AWS_IAM | AMAZON_COGNITO_USER_POOLS | OPENID_CONNECT,
      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 */
  ],
  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'
  }
};
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 AWS 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, AWS IAM, OIDC, or Amazon Cognito user pools.

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

      The Amazon Cognito user pool configuration.

      • userPoolIdrequired — (String)

        The user pool ID.

      • awsRegionrequired — (String)

        The AWS 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 AWS 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, AWS IAM, OIDC, or Amazon Cognito user pools.

        Possible values include:
        • "API_KEY"
        • "AWS_IAM"
        • "AMAZON_COGNITO_USER_POOLS"
        • "OPENID_CONNECT"
      • 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 AWS 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 AWS Region in which the user pool was created.

        • appIdClientRegex — (String)

          A regular expression for validating the incoming Amazon Cognito user pool app client 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:

      • 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"
        • 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 AWS 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 AWS 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 AWS 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, AWS IAM, OIDC, or Amazon Cognito user pools.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
          • 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 AWS 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 AWS Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID.

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 */
  requestMappingTemplate: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE', /* required */
  dataSourceName: 'STRING_VALUE',
  kind: UNIT | PIPELINE,
  pipelineConfig: {
    functions: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  responseMappingTemplate: '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).

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

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.

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.

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.

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.

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

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

          • AWS_LAMBDA: The data source is an AWS Lambda function.

          • 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"
        • serviceRoleArn — (String)

          The AWS IAM 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 AWS Region.

          • useCallerCredentials — (Boolean)

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

        • lambdaConfig — (map)

          AWS Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The ARN for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon Elasticsearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The AWS 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, AWS 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 AWS IAM settings.

              • signingRegion — (String)

                The signing region for AWS IAM authorization.

              • signingServiceName — (String)

                The signing service name for AWS IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              AWS Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster identifier.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

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

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"
        • 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 AWS 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 AWS 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 AWS 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, AWS IAM, OIDC, or Amazon Cognito user pools.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
          • 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 AWS 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 AWS Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID.

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.

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

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

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

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

          • AWS_LAMBDA: The data source is an AWS Lambda function.

          • 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"
        • serviceRoleArn — (String)

          The AWS IAM 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 AWS Region.

          • useCallerCredentials — (Boolean)

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

        • lambdaConfig — (map)

          AWS Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The ARN for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon Elasticsearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The AWS 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, AWS 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 AWS IAM settings.

              • signingRegion — (String)

                The signing region for AWS IAM authorization.

              • signingServiceName — (String)

                The signing service name for AWS IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              AWS Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster identifier.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

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

      • 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"
        • 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 AWS 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 AWS 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 AWS 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, AWS IAM, OIDC, or Amazon Cognito user pools.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
          • 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 AWS 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 AWS Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID.

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

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

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

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

Updates an API key.

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.

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, /* required */
  description: 'STRING_VALUE',
  dynamodbConfig: {
    awsRegion: 'STRING_VALUE', /* required */
    tableName: 'STRING_VALUE', /* required */
    useCallerCredentials: 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 */
  },
  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"
    • 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 AWS Region.

      • useCallerCredentials — (Boolean)

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

    • lambdaConfig — (map)

      The new AWS Lambda configuration.

      • lambdaFunctionArnrequired — (String)

        The ARN for the Lambda function.

    • elasticsearchConfig — (map)

      The new Elasticsearch Service configuration.

      • endpointrequired — (String)

        The endpoint.

      • awsRegionrequired — (String)

        The AWS 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, AWS 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 AWS IAM settings.

          • signingRegion — (String)

            The signing region for AWS IAM authorization.

          • signingServiceName — (String)

            The signing service name for AWS IAM authorization.

    • relationalDatabaseConfig — (map)

      The new relational database configuration.

      • relationalDatabaseSourceType — (String)

        Source type for the relational database.

        • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon RDS HTTP endpoint.

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

        Amazon RDS HTTP endpoint settings.

        • awsRegion — (String)

          AWS Region for RDS HTTP endpoint.

        • dbClusterIdentifier — (String)

          Amazon RDS cluster identifier.

        • databaseName — (String)

          Logical database name.

        • schema — (String)

          Logical schema name.

        • awsSecretStoreArn — (String)

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

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

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

          • AWS_LAMBDA: The data source is an AWS Lambda function.

          • 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"
        • serviceRoleArn — (String)

          The AWS IAM 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 AWS Region.

          • useCallerCredentials — (Boolean)

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

        • lambdaConfig — (map)

          AWS Lambda settings.

          • lambdaFunctionArnrequired — (String)

            The ARN for the Lambda function.

        • elasticsearchConfig — (map)

          Amazon Elasticsearch Service settings.

          • endpointrequired — (String)

            The endpoint.

          • awsRegionrequired — (String)

            The AWS 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, AWS 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 AWS IAM settings.

              • signingRegion — (String)

                The signing region for AWS IAM authorization.

              • signingServiceName — (String)

                The signing service name for AWS IAM authorization.

        • relationalDatabaseConfig — (map)

          Relational database settings.

          • relationalDatabaseSourceType — (String)

            Source type for the relational database.

            • RDS_HTTP_ENDPOINT: The relational database source type is an Amazon RDS HTTP endpoint.

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

            Amazon RDS HTTP endpoint settings.

            • awsRegion — (String)

              AWS Region for RDS HTTP endpoint.

            • dbClusterIdentifier — (String)

              Amazon RDS cluster identifier.

            • databaseName — (String)

              Logical database name.

            • schema — (String)

              Logical schema name.

            • awsSecretStoreArn — (String)

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

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.

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,
      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,
  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'
  }
};
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 AWS 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"
    • userPoolConfig — (map)

      The new Amazon Cognito user pool configuration for the GraphqlApi object.

      • userPoolIdrequired — (String)

        The user pool ID.

      • awsRegionrequired — (String)

        The AWS 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 AWS 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, AWS IAM, OIDC, or Amazon Cognito user pools.

        Possible values include:
        • "API_KEY"
        • "AWS_IAM"
        • "AMAZON_COGNITO_USER_POOLS"
        • "OPENID_CONNECT"
      • 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 AWS 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 AWS Region in which the user pool was created.

        • appIdClientRegex — (String)

          A regular expression for validating the incoming Amazon Cognito user pool app client 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:

      • 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"
        • 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 AWS 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 AWS 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 AWS 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, AWS IAM, OIDC, or Amazon Cognito user pools.

            Possible values include:
            • "API_KEY"
            • "AWS_IAM"
            • "AMAZON_COGNITO_USER_POOLS"
            • "OPENID_CONNECT"
          • 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 AWS 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 AWS Region in which the user pool was created.

            • appIdClientRegex — (String)

              A regular expression for validating the incoming Amazon Cognito user pool app client ID.

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 */
  requestMappingTemplate: 'STRING_VALUE', /* required */
  typeName: 'STRING_VALUE', /* required */
  dataSourceName: 'STRING_VALUE',
  kind: UNIT | PIPELINE,
  pipelineConfig: {
    functions: [
      'STRING_VALUE',
      /* more items */
    ]
  },
  responseMappingTemplate: '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.

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

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.

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.