AWS AppSync

2022/01/06 - AWS AppSync - 9 updated api methods

Changes  AppSync: AWS AppSync now supports configurable batching sizes for AWS Lambda resolvers, Direct AWS Lambda resolvers and pipeline functions

CreateFunction (updated) Link ¶
Changes (request, response)
Request
{'maxBatchSize': 'integer'}
Response
{'functionConfiguration': {'maxBatchSize': 'integer'}}

Creates a Function object.

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

See also: AWS API Documentation

Request Syntax

client.create_function(
    apiId='string',
    name='string',
    description='string',
    dataSourceName='string',
    requestMappingTemplate='string',
    responseMappingTemplate='string',
    functionVersion='string',
    syncConfig={
        'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
        'conflictDetection': 'VERSION'|'NONE',
        'lambdaConflictHandlerConfig': {
            'lambdaConflictHandlerArn': 'string'
        }
    },
    maxBatchSize=123
)
type apiId

string

param apiId

[REQUIRED]

The GraphQL API ID.

type name

string

param name

[REQUIRED]

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

type description

string

param description

The Function description.

type dataSourceName

string

param dataSourceName

[REQUIRED]

The Function DataSource name.

type requestMappingTemplate

string

param requestMappingTemplate

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

type responseMappingTemplate

string

param responseMappingTemplate

The Function response mapping template.

type functionVersion

string

param functionVersion

[REQUIRED]

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

type syncConfig

dict

param syncConfig

Describes a Sync configuration for a resolver.

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

  • conflictHandler (string) --

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

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

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

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

  • conflictDetection (string) --

    The Conflict Detection strategy to use.

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

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

  • lambdaConflictHandlerConfig (dict) --

    The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

    • lambdaConflictHandlerArn (string) --

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

type maxBatchSize

integer

param maxBatchSize

The maximum batching size for a resolver.

rtype

dict

returns

Response Syntax

{
    'functionConfiguration': {
        'functionId': 'string',
        'functionArn': 'string',
        'name': 'string',
        'description': 'string',
        'dataSourceName': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'functionVersion': 'string',
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        },
        'maxBatchSize': 123
    }
}

Response Structure

  • (dict) --

    • functionConfiguration (dict) --

      The Function object.

      • functionId (string) --

        A unique ID representing the Function object.

      • functionArn (string) --

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

      • name (string) --

        The name of the Function object.

      • description (string) --

        The Function description.

      • dataSourceName (string) --

        The name of the DataSource .

      • requestMappingTemplate (string) --

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

      • responseMappingTemplate (string) --

        The Function response mapping template.

      • functionVersion (string) --

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

      • syncConfig (dict) --

        Describes a Sync configuration for a resolver.

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

        • conflictHandler (string) --

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

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

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

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

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

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

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

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

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

      • maxBatchSize (integer) --

        The maximum batching size for a resolver.

CreateResolver (updated) Link ¶
Changes (request, response)
Request
{'maxBatchSize': 'integer'}
Response
{'resolver': {'maxBatchSize': 'integer'}}

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.

See also: AWS API Documentation

Request Syntax

client.create_resolver(
    apiId='string',
    typeName='string',
    fieldName='string',
    dataSourceName='string',
    requestMappingTemplate='string',
    responseMappingTemplate='string',
    kind='UNIT'|'PIPELINE',
    pipelineConfig={
        'functions': [
            'string',
        ]
    },
    syncConfig={
        'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
        'conflictDetection': 'VERSION'|'NONE',
        'lambdaConflictHandlerConfig': {
            'lambdaConflictHandlerArn': 'string'
        }
    },
    cachingConfig={
        'ttl': 123,
        'cachingKeys': [
            'string',
        ]
    },
    maxBatchSize=123
)
type apiId

string

param apiId

[REQUIRED]

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

type typeName

string

param typeName

[REQUIRED]

The name of the Type .

type fieldName

string

param fieldName

[REQUIRED]

The name of the field to attach the resolver to.

type dataSourceName

string

param dataSourceName

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

type requestMappingTemplate

string

param requestMappingTemplate

The mapping template to use for requests.

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

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

type responseMappingTemplate

string

param responseMappingTemplate

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

type kind

string

param kind

The resolver type.

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

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

type pipelineConfig

dict

param pipelineConfig

The PipelineConfig .

  • functions (list) --

    A list of Function objects.

    • (string) --

type syncConfig

dict

param syncConfig

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

  • conflictHandler (string) --

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

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

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

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

  • conflictDetection (string) --

    The Conflict Detection strategy to use.

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

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

  • lambdaConflictHandlerConfig (dict) --

    The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

    • lambdaConflictHandlerArn (string) --

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

type cachingConfig

dict

param cachingConfig

The caching configuration for the resolver.

  • ttl (integer) --

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

    Valid values are 1–3,600 seconds.

  • cachingKeys (list) --

    The caching keys for a resolver that has caching activated.

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

    • (string) --

type maxBatchSize

integer

param maxBatchSize

The maximum batching size for a resolver.

rtype

dict

returns

Response Syntax

{
    'resolver': {
        'typeName': 'string',
        'fieldName': 'string',
        'dataSourceName': 'string',
        'resolverArn': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'kind': 'UNIT'|'PIPELINE',
        'pipelineConfig': {
            'functions': [
                'string',
            ]
        },
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        },
        'cachingConfig': {
            'ttl': 123,
            'cachingKeys': [
                'string',
            ]
        },
        'maxBatchSize': 123
    }
}

Response Structure

  • (dict) --

    • resolver (dict) --

      The Resolver object.

      • typeName (string) --

        The resolver type name.

      • fieldName (string) --

        The resolver field name.

      • dataSourceName (string) --

        The resolver data source name.

      • resolverArn (string) --

        The resolver Amazon Resource Name (ARN).

      • requestMappingTemplate (string) --

        The request mapping template.

      • responseMappingTemplate (string) --

        The response mapping template.

      • kind (string) --

        The resolver type.

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

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

      • pipelineConfig (dict) --

        The PipelineConfig .

        • functions (list) --

          A list of Function objects.

          • (string) --

      • syncConfig (dict) --

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

        • conflictHandler (string) --

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

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

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

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

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

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

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

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

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

      • cachingConfig (dict) --

        The caching configuration for the resolver.

        • ttl (integer) --

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

          Valid values are 1–3,600 seconds.

        • cachingKeys (list) --

          The caching keys for a resolver that has caching activated.

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

          • (string) --

      • maxBatchSize (integer) --

        The maximum batching size for a resolver.

GetFunction (updated) Link ¶
Changes (response)
{'functionConfiguration': {'maxBatchSize': 'integer'}}

Get a Function .

See also: AWS API Documentation

Request Syntax

client.get_function(
    apiId='string',
    functionId='string'
)
type apiId

string

param apiId

[REQUIRED]

The GraphQL API ID.

type functionId

string

param functionId

[REQUIRED]

The Function ID.

rtype

dict

returns

Response Syntax

{
    'functionConfiguration': {
        'functionId': 'string',
        'functionArn': 'string',
        'name': 'string',
        'description': 'string',
        'dataSourceName': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'functionVersion': 'string',
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        },
        'maxBatchSize': 123
    }
}

Response Structure

  • (dict) --

    • functionConfiguration (dict) --

      The Function object.

      • functionId (string) --

        A unique ID representing the Function object.

      • functionArn (string) --

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

      • name (string) --

        The name of the Function object.

      • description (string) --

        The Function description.

      • dataSourceName (string) --

        The name of the DataSource .

      • requestMappingTemplate (string) --

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

      • responseMappingTemplate (string) --

        The Function response mapping template.

      • functionVersion (string) --

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

      • syncConfig (dict) --

        Describes a Sync configuration for a resolver.

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

        • conflictHandler (string) --

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

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

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

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

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

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

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

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

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

      • maxBatchSize (integer) --

        The maximum batching size for a resolver.

GetResolver (updated) Link ¶
Changes (response)
{'resolver': {'maxBatchSize': 'integer'}}

Retrieves a Resolver object.

See also: AWS API Documentation

Request Syntax

client.get_resolver(
    apiId='string',
    typeName='string',
    fieldName='string'
)
type apiId

string

param apiId

[REQUIRED]

The API ID.

type typeName

string

param typeName

[REQUIRED]

The resolver type name.

type fieldName

string

param fieldName

[REQUIRED]

The resolver field name.

rtype

dict

returns

Response Syntax

{
    'resolver': {
        'typeName': 'string',
        'fieldName': 'string',
        'dataSourceName': 'string',
        'resolverArn': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'kind': 'UNIT'|'PIPELINE',
        'pipelineConfig': {
            'functions': [
                'string',
            ]
        },
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        },
        'cachingConfig': {
            'ttl': 123,
            'cachingKeys': [
                'string',
            ]
        },
        'maxBatchSize': 123
    }
}

Response Structure

  • (dict) --

    • resolver (dict) --

      The Resolver object.

      • typeName (string) --

        The resolver type name.

      • fieldName (string) --

        The resolver field name.

      • dataSourceName (string) --

        The resolver data source name.

      • resolverArn (string) --

        The resolver Amazon Resource Name (ARN).

      • requestMappingTemplate (string) --

        The request mapping template.

      • responseMappingTemplate (string) --

        The response mapping template.

      • kind (string) --

        The resolver type.

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

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

      • pipelineConfig (dict) --

        The PipelineConfig .

        • functions (list) --

          A list of Function objects.

          • (string) --

      • syncConfig (dict) --

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

        • conflictHandler (string) --

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

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

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

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

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

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

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

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

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

      • cachingConfig (dict) --

        The caching configuration for the resolver.

        • ttl (integer) --

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

          Valid values are 1–3,600 seconds.

        • cachingKeys (list) --

          The caching keys for a resolver that has caching activated.

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

          • (string) --

      • maxBatchSize (integer) --

        The maximum batching size for a resolver.

ListFunctions (updated) Link ¶
Changes (response)
{'functions': {'maxBatchSize': 'integer'}}

List multiple functions.

See also: AWS API Documentation

Request Syntax

client.list_functions(
    apiId='string',
    nextToken='string',
    maxResults=123
)
type apiId

string

param apiId

[REQUIRED]

The GraphQL API ID.

type nextToken

string

param nextToken

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.

type maxResults

integer

param maxResults

The maximum number of results that you want the request to return.

rtype

dict

returns

Response Syntax

{
    'functions': [
        {
            'functionId': 'string',
            'functionArn': 'string',
            'name': 'string',
            'description': 'string',
            'dataSourceName': 'string',
            'requestMappingTemplate': 'string',
            'responseMappingTemplate': 'string',
            'functionVersion': 'string',
            'syncConfig': {
                'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
                'conflictDetection': 'VERSION'|'NONE',
                'lambdaConflictHandlerConfig': {
                    'lambdaConflictHandlerArn': 'string'
                }
            },
            'maxBatchSize': 123
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • functions (list) --

      A list of Function objects.

      • (dict) --

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

        • functionId (string) --

          A unique ID representing the Function object.

        • functionArn (string) --

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

        • name (string) --

          The name of the Function object.

        • description (string) --

          The Function description.

        • dataSourceName (string) --

          The name of the DataSource .

        • requestMappingTemplate (string) --

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

        • responseMappingTemplate (string) --

          The Function response mapping template.

        • functionVersion (string) --

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

        • syncConfig (dict) --

          Describes a Sync configuration for a resolver.

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

          • conflictHandler (string) --

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

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

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

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

          • conflictDetection (string) --

            The Conflict Detection strategy to use.

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

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

          • lambdaConflictHandlerConfig (dict) --

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn (string) --

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

        • maxBatchSize (integer) --

          The maximum batching size for a resolver.

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

ListResolvers (updated) Link ¶
Changes (response)
{'resolvers': {'maxBatchSize': 'integer'}}

Lists the resolvers for a given API and type.

See also: AWS API Documentation

Request Syntax

client.list_resolvers(
    apiId='string',
    typeName='string',
    nextToken='string',
    maxResults=123
)
type apiId

string

param apiId

[REQUIRED]

The API ID.

type typeName

string

param typeName

[REQUIRED]

The type name.

type nextToken

string

param nextToken

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.

type maxResults

integer

param maxResults

The maximum number of results that you want the request to return.

rtype

dict

returns

Response Syntax

{
    'resolvers': [
        {
            'typeName': 'string',
            'fieldName': 'string',
            'dataSourceName': 'string',
            'resolverArn': 'string',
            'requestMappingTemplate': 'string',
            'responseMappingTemplate': 'string',
            'kind': 'UNIT'|'PIPELINE',
            'pipelineConfig': {
                'functions': [
                    'string',
                ]
            },
            'syncConfig': {
                'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
                'conflictDetection': 'VERSION'|'NONE',
                'lambdaConflictHandlerConfig': {
                    'lambdaConflictHandlerArn': 'string'
                }
            },
            'cachingConfig': {
                'ttl': 123,
                'cachingKeys': [
                    'string',
                ]
            },
            'maxBatchSize': 123
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • resolvers (list) --

      The Resolver objects.

      • (dict) --

        Describes a resolver.

        • typeName (string) --

          The resolver type name.

        • fieldName (string) --

          The resolver field name.

        • dataSourceName (string) --

          The resolver data source name.

        • resolverArn (string) --

          The resolver Amazon Resource Name (ARN).

        • requestMappingTemplate (string) --

          The request mapping template.

        • responseMappingTemplate (string) --

          The response mapping template.

        • kind (string) --

          The resolver type.

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

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

        • pipelineConfig (dict) --

          The PipelineConfig .

          • functions (list) --

            A list of Function objects.

            • (string) --

        • syncConfig (dict) --

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

          • conflictHandler (string) --

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

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

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

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

          • conflictDetection (string) --

            The Conflict Detection strategy to use.

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

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

          • lambdaConflictHandlerConfig (dict) --

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn (string) --

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

        • cachingConfig (dict) --

          The caching configuration for the resolver.

          • ttl (integer) --

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

            Valid values are 1–3,600 seconds.

          • cachingKeys (list) --

            The caching keys for a resolver that has caching activated.

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

            • (string) --

        • maxBatchSize (integer) --

          The maximum batching size for a resolver.

    • nextToken (string) --

      An identifier to pass in the next request to this operation to return the next set of items in the list.

ListResolversByFunction (updated) Link ¶
Changes (response)
{'resolvers': {'maxBatchSize': 'integer'}}

List the resolvers that are associated with a specific function.

See also: AWS API Documentation

Request Syntax

client.list_resolvers_by_function(
    apiId='string',
    functionId='string',
    nextToken='string',
    maxResults=123
)
type apiId

string

param apiId

[REQUIRED]

The API ID.

type functionId

string

param functionId

[REQUIRED]

The function ID.

type nextToken

string

param nextToken

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.

type maxResults

integer

param maxResults

The maximum number of results that you want the request to return.

rtype

dict

returns

Response Syntax

{
    'resolvers': [
        {
            'typeName': 'string',
            'fieldName': 'string',
            'dataSourceName': 'string',
            'resolverArn': 'string',
            'requestMappingTemplate': 'string',
            'responseMappingTemplate': 'string',
            'kind': 'UNIT'|'PIPELINE',
            'pipelineConfig': {
                'functions': [
                    'string',
                ]
            },
            'syncConfig': {
                'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
                'conflictDetection': 'VERSION'|'NONE',
                'lambdaConflictHandlerConfig': {
                    'lambdaConflictHandlerArn': 'string'
                }
            },
            'cachingConfig': {
                'ttl': 123,
                'cachingKeys': [
                    'string',
                ]
            },
            'maxBatchSize': 123
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • resolvers (list) --

      The list of resolvers.

      • (dict) --

        Describes a resolver.

        • typeName (string) --

          The resolver type name.

        • fieldName (string) --

          The resolver field name.

        • dataSourceName (string) --

          The resolver data source name.

        • resolverArn (string) --

          The resolver Amazon Resource Name (ARN).

        • requestMappingTemplate (string) --

          The request mapping template.

        • responseMappingTemplate (string) --

          The response mapping template.

        • kind (string) --

          The resolver type.

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

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

        • pipelineConfig (dict) --

          The PipelineConfig .

          • functions (list) --

            A list of Function objects.

            • (string) --

        • syncConfig (dict) --

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

          • conflictHandler (string) --

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

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

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

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

          • conflictDetection (string) --

            The Conflict Detection strategy to use.

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

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

          • lambdaConflictHandlerConfig (dict) --

            The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

            • lambdaConflictHandlerArn (string) --

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

        • cachingConfig (dict) --

          The caching configuration for the resolver.

          • ttl (integer) --

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

            Valid values are 1–3,600 seconds.

          • cachingKeys (list) --

            The caching keys for a resolver that has caching activated.

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

            • (string) --

        • maxBatchSize (integer) --

          The maximum batching size for a resolver.

    • nextToken (string) --

      An identifier that you can use to return the next set of items in the list.

UpdateFunction (updated) Link ¶
Changes (request, response)
Request
{'maxBatchSize': 'integer'}
Response
{'functionConfiguration': {'maxBatchSize': 'integer'}}

Updates a Function object.

See also: AWS API Documentation

Request Syntax

client.update_function(
    apiId='string',
    name='string',
    description='string',
    functionId='string',
    dataSourceName='string',
    requestMappingTemplate='string',
    responseMappingTemplate='string',
    functionVersion='string',
    syncConfig={
        'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
        'conflictDetection': 'VERSION'|'NONE',
        'lambdaConflictHandlerConfig': {
            'lambdaConflictHandlerArn': 'string'
        }
    },
    maxBatchSize=123
)
type apiId

string

param apiId

[REQUIRED]

The GraphQL API ID.

type name

string

param name

[REQUIRED]

The Function name.

type description

string

param description

The Function description.

type functionId

string

param functionId

[REQUIRED]

The function ID.

type dataSourceName

string

param dataSourceName

[REQUIRED]

The Function DataSource name.

type requestMappingTemplate

string

param requestMappingTemplate

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

type responseMappingTemplate

string

param responseMappingTemplate

The Function request mapping template.

type functionVersion

string

param functionVersion

[REQUIRED]

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

type syncConfig

dict

param syncConfig

Describes a Sync configuration for a resolver.

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

  • conflictHandler (string) --

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

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

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

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

  • conflictDetection (string) --

    The Conflict Detection strategy to use.

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

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

  • lambdaConflictHandlerConfig (dict) --

    The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

    • lambdaConflictHandlerArn (string) --

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

type maxBatchSize

integer

param maxBatchSize

The maximum batching size for a resolver.

rtype

dict

returns

Response Syntax

{
    'functionConfiguration': {
        'functionId': 'string',
        'functionArn': 'string',
        'name': 'string',
        'description': 'string',
        'dataSourceName': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'functionVersion': 'string',
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        },
        'maxBatchSize': 123
    }
}

Response Structure

  • (dict) --

    • functionConfiguration (dict) --

      The Function object.

      • functionId (string) --

        A unique ID representing the Function object.

      • functionArn (string) --

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

      • name (string) --

        The name of the Function object.

      • description (string) --

        The Function description.

      • dataSourceName (string) --

        The name of the DataSource .

      • requestMappingTemplate (string) --

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

      • responseMappingTemplate (string) --

        The Function response mapping template.

      • functionVersion (string) --

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

      • syncConfig (dict) --

        Describes a Sync configuration for a resolver.

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

        • conflictHandler (string) --

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

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

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

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

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

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

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

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

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

      • maxBatchSize (integer) --

        The maximum batching size for a resolver.

UpdateResolver (updated) Link ¶
Changes (request, response)
Request
{'maxBatchSize': 'integer'}
Response
{'resolver': {'maxBatchSize': 'integer'}}

Updates a Resolver object.

See also: AWS API Documentation

Request Syntax

client.update_resolver(
    apiId='string',
    typeName='string',
    fieldName='string',
    dataSourceName='string',
    requestMappingTemplate='string',
    responseMappingTemplate='string',
    kind='UNIT'|'PIPELINE',
    pipelineConfig={
        'functions': [
            'string',
        ]
    },
    syncConfig={
        'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
        'conflictDetection': 'VERSION'|'NONE',
        'lambdaConflictHandlerConfig': {
            'lambdaConflictHandlerArn': 'string'
        }
    },
    cachingConfig={
        'ttl': 123,
        'cachingKeys': [
            'string',
        ]
    },
    maxBatchSize=123
)
type apiId

string

param apiId

[REQUIRED]

The API ID.

type typeName

string

param typeName

[REQUIRED]

The new type name.

type fieldName

string

param fieldName

[REQUIRED]

The new field name.

type dataSourceName

string

param dataSourceName

The new data source name.

type requestMappingTemplate

string

param requestMappingTemplate

The new request mapping template.

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

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

type responseMappingTemplate

string

param responseMappingTemplate

The new response mapping template.

type kind

string

param kind

The resolver type.

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

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

type pipelineConfig

dict

param pipelineConfig

The PipelineConfig .

  • functions (list) --

    A list of Function objects.

    • (string) --

type syncConfig

dict

param syncConfig

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

  • conflictHandler (string) --

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

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

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

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

  • conflictDetection (string) --

    The Conflict Detection strategy to use.

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

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

  • lambdaConflictHandlerConfig (dict) --

    The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

    • lambdaConflictHandlerArn (string) --

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

type cachingConfig

dict

param cachingConfig

The caching configuration for the resolver.

  • ttl (integer) --

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

    Valid values are 1–3,600 seconds.

  • cachingKeys (list) --

    The caching keys for a resolver that has caching activated.

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

    • (string) --

type maxBatchSize

integer

param maxBatchSize

The maximum batching size for a resolver.

rtype

dict

returns

Response Syntax

{
    'resolver': {
        'typeName': 'string',
        'fieldName': 'string',
        'dataSourceName': 'string',
        'resolverArn': 'string',
        'requestMappingTemplate': 'string',
        'responseMappingTemplate': 'string',
        'kind': 'UNIT'|'PIPELINE',
        'pipelineConfig': {
            'functions': [
                'string',
            ]
        },
        'syncConfig': {
            'conflictHandler': 'OPTIMISTIC_CONCURRENCY'|'LAMBDA'|'AUTOMERGE'|'NONE',
            'conflictDetection': 'VERSION'|'NONE',
            'lambdaConflictHandlerConfig': {
                'lambdaConflictHandlerArn': 'string'
            }
        },
        'cachingConfig': {
            'ttl': 123,
            'cachingKeys': [
                'string',
            ]
        },
        'maxBatchSize': 123
    }
}

Response Structure

  • (dict) --

    • resolver (dict) --

      The updated Resolver object.

      • typeName (string) --

        The resolver type name.

      • fieldName (string) --

        The resolver field name.

      • dataSourceName (string) --

        The resolver data source name.

      • resolverArn (string) --

        The resolver Amazon Resource Name (ARN).

      • requestMappingTemplate (string) --

        The request mapping template.

      • responseMappingTemplate (string) --

        The response mapping template.

      • kind (string) --

        The resolver type.

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

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

      • pipelineConfig (dict) --

        The PipelineConfig .

        • functions (list) --

          A list of Function objects.

          • (string) --

      • syncConfig (dict) --

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

        • conflictHandler (string) --

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

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

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

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

        • conflictDetection (string) --

          The Conflict Detection strategy to use.

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

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

        • lambdaConflictHandlerConfig (dict) --

          The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.

          • lambdaConflictHandlerArn (string) --

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

      • cachingConfig (dict) --

        The caching configuration for the resolver.

        • ttl (integer) --

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

          Valid values are 1–3,600 seconds.

        • cachingKeys (list) --

          The caching keys for a resolver that has caching activated.

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

          • (string) --

      • maxBatchSize (integer) --

        The maximum batching size for a resolver.