Skip to content

AppSyncClient#

Index > AppSync > AppSyncClient

Auto-generated documentation for AppSync type annotations stubs module mypy-boto3-appsync.

AppSyncClient#

Type annotations and code completion for boto3.client("appsync"). boto3 documentation

# AppSyncClient usage example

from boto3.session import Session
from mypy_boto3_appsync.client import AppSyncClient

def get_appsync_client() -> AppSyncClient:
    return Session().client("appsync")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("appsync").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("appsync")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.ApiKeyLimitExceededException,
    client.exceptions.ApiKeyValidityOutOfBoundsException,
    client.exceptions.ApiLimitExceededException,
    client.exceptions.BadRequestException,
    client.exceptions.ClientError,
    client.exceptions.ConcurrentModificationException,
    client.exceptions.GraphQLSchemaException,
    client.exceptions.InternalFailureException,
    client.exceptions.LimitExceededException,
    client.exceptions.NotFoundException,
    client.exceptions.UnauthorizedException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_appsync.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

associate_api#

Maps an endpoint to your custom domain.

Type annotations and code completion for boto3.client("appsync").associate_api method. boto3 documentation

# associate_api method definition

def associate_api(
    self,
    *,
    domainName: str,
    apiId: str,
) -> AssociateApiResponseTypeDef:  # (1)
    ...
  1. See AssociateApiResponseTypeDef
# associate_api method usage example with argument unpacking

kwargs: AssociateApiRequestRequestTypeDef = {  # (1)
    "domainName": ...,
    "apiId": ...,
}

parent.associate_api(**kwargs)
  1. See AssociateApiRequestRequestTypeDef

associate_merged_graphql_api#

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

Type annotations and code completion for boto3.client("appsync").associate_merged_graphql_api method. boto3 documentation

# associate_merged_graphql_api method definition

def associate_merged_graphql_api(
    self,
    *,
    sourceApiIdentifier: str,
    mergedApiIdentifier: str,
    description: str = ...,
    sourceApiAssociationConfig: SourceApiAssociationConfigTypeDef = ...,  # (1)
) -> AssociateMergedGraphqlApiResponseTypeDef:  # (2)
    ...
  1. See SourceApiAssociationConfigTypeDef
  2. See AssociateMergedGraphqlApiResponseTypeDef
# associate_merged_graphql_api method usage example with argument unpacking

kwargs: AssociateMergedGraphqlApiRequestRequestTypeDef = {  # (1)
    "sourceApiIdentifier": ...,
    "mergedApiIdentifier": ...,
}

parent.associate_merged_graphql_api(**kwargs)
  1. See AssociateMergedGraphqlApiRequestRequestTypeDef

associate_source_graphql_api#

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

Type annotations and code completion for boto3.client("appsync").associate_source_graphql_api method. boto3 documentation

# associate_source_graphql_api method definition

def associate_source_graphql_api(
    self,
    *,
    mergedApiIdentifier: str,
    sourceApiIdentifier: str,
    description: str = ...,
    sourceApiAssociationConfig: SourceApiAssociationConfigTypeDef = ...,  # (1)
) -> AssociateSourceGraphqlApiResponseTypeDef:  # (2)
    ...
  1. See SourceApiAssociationConfigTypeDef
  2. See AssociateSourceGraphqlApiResponseTypeDef
# associate_source_graphql_api method usage example with argument unpacking

kwargs: AssociateSourceGraphqlApiRequestRequestTypeDef = {  # (1)
    "mergedApiIdentifier": ...,
    "sourceApiIdentifier": ...,
}

parent.associate_source_graphql_api(**kwargs)
  1. See AssociateSourceGraphqlApiRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("appsync").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("appsync").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

create_api_cache#

Creates a cache for the GraphQL API.

Type annotations and code completion for boto3.client("appsync").create_api_cache method. boto3 documentation

# create_api_cache method definition

def create_api_cache(
    self,
    *,
    apiId: str,
    ttl: int,
    apiCachingBehavior: ApiCachingBehaviorType,  # (1)
    type: ApiCacheTypeType,  # (2)
    transitEncryptionEnabled: bool = ...,
    atRestEncryptionEnabled: bool = ...,
) -> CreateApiCacheResponseTypeDef:  # (3)
    ...
  1. See ApiCachingBehaviorType
  2. See ApiCacheTypeType
  3. See CreateApiCacheResponseTypeDef
# create_api_cache method usage example with argument unpacking

kwargs: CreateApiCacheRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "ttl": ...,
    "apiCachingBehavior": ...,
    "type": ...,
}

parent.create_api_cache(**kwargs)
  1. See CreateApiCacheRequestRequestTypeDef

create_api_key#

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

Type annotations and code completion for boto3.client("appsync").create_api_key method. boto3 documentation

# create_api_key method definition

def create_api_key(
    self,
    *,
    apiId: str,
    description: str = ...,
    expires: int = ...,
) -> CreateApiKeyResponseTypeDef:  # (1)
    ...
  1. See CreateApiKeyResponseTypeDef
# create_api_key method usage example with argument unpacking

kwargs: CreateApiKeyRequestRequestTypeDef = {  # (1)
    "apiId": ...,
}

parent.create_api_key(**kwargs)
  1. See CreateApiKeyRequestRequestTypeDef

create_data_source#

Creates a DataSource object.

Type annotations and code completion for boto3.client("appsync").create_data_source method. boto3 documentation

# create_data_source method definition

def create_data_source(
    self,
    *,
    apiId: str,
    name: str,
    type: DataSourceTypeType,  # (1)
    description: str = ...,
    serviceRoleArn: str = ...,
    dynamodbConfig: DynamodbDataSourceConfigTypeDef = ...,  # (2)
    lambdaConfig: LambdaDataSourceConfigTypeDef = ...,  # (3)
    elasticsearchConfig: ElasticsearchDataSourceConfigTypeDef = ...,  # (4)
    openSearchServiceConfig: OpenSearchServiceDataSourceConfigTypeDef = ...,  # (5)
    httpConfig: HttpDataSourceConfigTypeDef = ...,  # (6)
    relationalDatabaseConfig: RelationalDatabaseDataSourceConfigTypeDef = ...,  # (7)
    eventBridgeConfig: EventBridgeDataSourceConfigTypeDef = ...,  # (8)
) -> CreateDataSourceResponseTypeDef:  # (9)
    ...
  1. See DataSourceTypeType
  2. See DynamodbDataSourceConfigTypeDef
  3. See LambdaDataSourceConfigTypeDef
  4. See ElasticsearchDataSourceConfigTypeDef
  5. See OpenSearchServiceDataSourceConfigTypeDef
  6. See HttpDataSourceConfigTypeDef
  7. See RelationalDatabaseDataSourceConfigTypeDef
  8. See EventBridgeDataSourceConfigTypeDef
  9. See CreateDataSourceResponseTypeDef
# create_data_source method usage example with argument unpacking

kwargs: CreateDataSourceRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "name": ...,
    "type": ...,
}

parent.create_data_source(**kwargs)
  1. See CreateDataSourceRequestRequestTypeDef

create_domain_name#

Creates a custom DomainName object.

Type annotations and code completion for boto3.client("appsync").create_domain_name method. boto3 documentation

# create_domain_name method definition

def create_domain_name(
    self,
    *,
    domainName: str,
    certificateArn: str,
    description: str = ...,
) -> CreateDomainNameResponseTypeDef:  # (1)
    ...
  1. See CreateDomainNameResponseTypeDef
# create_domain_name method usage example with argument unpacking

kwargs: CreateDomainNameRequestRequestTypeDef = {  # (1)
    "domainName": ...,
    "certificateArn": ...,
}

parent.create_domain_name(**kwargs)
  1. See CreateDomainNameRequestRequestTypeDef

create_function#

Creates a Function object.

Type annotations and code completion for boto3.client("appsync").create_function method. boto3 documentation

# create_function method definition

def create_function(
    self,
    *,
    apiId: str,
    name: str,
    dataSourceName: str,
    description: str = ...,
    requestMappingTemplate: str = ...,
    responseMappingTemplate: str = ...,
    functionVersion: str = ...,
    syncConfig: SyncConfigTypeDef = ...,  # (1)
    maxBatchSize: int = ...,
    runtime: AppSyncRuntimeTypeDef = ...,  # (2)
    code: str = ...,
) -> CreateFunctionResponseTypeDef:  # (3)
    ...
  1. See SyncConfigTypeDef
  2. See AppSyncRuntimeTypeDef
  3. See CreateFunctionResponseTypeDef
# create_function method usage example with argument unpacking

kwargs: CreateFunctionRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "name": ...,
    "dataSourceName": ...,
}

parent.create_function(**kwargs)
  1. See CreateFunctionRequestRequestTypeDef

create_graphql_api#

Creates a GraphqlApi object.

Type annotations and code completion for boto3.client("appsync").create_graphql_api method. boto3 documentation

# create_graphql_api method definition

def create_graphql_api(
    self,
    *,
    name: str,
    authenticationType: AuthenticationTypeType,  # (1)
    logConfig: LogConfigTypeDef = ...,  # (2)
    userPoolConfig: UserPoolConfigTypeDef = ...,  # (3)
    openIDConnectConfig: OpenIDConnectConfigTypeDef = ...,  # (4)
    tags: Mapping[str, str] = ...,
    additionalAuthenticationProviders: Sequence[AdditionalAuthenticationProviderTypeDef] = ...,  # (5)
    xrayEnabled: bool = ...,
    lambdaAuthorizerConfig: LambdaAuthorizerConfigTypeDef = ...,  # (6)
    visibility: GraphQLApiVisibilityType = ...,  # (7)
    apiType: GraphQLApiTypeType = ...,  # (8)
    mergedApiExecutionRoleArn: str = ...,
    ownerContact: str = ...,
) -> CreateGraphqlApiResponseTypeDef:  # (9)
    ...
  1. See AuthenticationTypeType
  2. See LogConfigTypeDef
  3. See UserPoolConfigTypeDef
  4. See OpenIDConnectConfigTypeDef
  5. See AdditionalAuthenticationProviderTypeDef
  6. See LambdaAuthorizerConfigTypeDef
  7. See GraphQLApiVisibilityType
  8. See GraphQLApiTypeType
  9. See CreateGraphqlApiResponseTypeDef
# create_graphql_api method usage example with argument unpacking

kwargs: CreateGraphqlApiRequestRequestTypeDef = {  # (1)
    "name": ...,
    "authenticationType": ...,
}

parent.create_graphql_api(**kwargs)
  1. See CreateGraphqlApiRequestRequestTypeDef

create_resolver#

Creates a Resolver object.

Type annotations and code completion for boto3.client("appsync").create_resolver method. boto3 documentation

# create_resolver method definition

def create_resolver(
    self,
    *,
    apiId: str,
    typeName: str,
    fieldName: str,
    dataSourceName: str = ...,
    requestMappingTemplate: str = ...,
    responseMappingTemplate: str = ...,
    kind: ResolverKindType = ...,  # (1)
    pipelineConfig: PipelineConfigTypeDef = ...,  # (2)
    syncConfig: SyncConfigTypeDef = ...,  # (3)
    cachingConfig: CachingConfigTypeDef = ...,  # (4)
    maxBatchSize: int = ...,
    runtime: AppSyncRuntimeTypeDef = ...,  # (5)
    code: str = ...,
) -> CreateResolverResponseTypeDef:  # (6)
    ...
  1. See ResolverKindType
  2. See PipelineConfigTypeDef
  3. See SyncConfigTypeDef
  4. See CachingConfigTypeDef
  5. See AppSyncRuntimeTypeDef
  6. See CreateResolverResponseTypeDef
# create_resolver method usage example with argument unpacking

kwargs: CreateResolverRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "typeName": ...,
    "fieldName": ...,
}

parent.create_resolver(**kwargs)
  1. See CreateResolverRequestRequestTypeDef

create_type#

Creates a Type object.

Type annotations and code completion for boto3.client("appsync").create_type method. boto3 documentation

# create_type method definition

def create_type(
    self,
    *,
    apiId: str,
    definition: str,
    format: TypeDefinitionFormatType,  # (1)
) -> CreateTypeResponseTypeDef:  # (2)
    ...
  1. See TypeDefinitionFormatType
  2. See CreateTypeResponseTypeDef
# create_type method usage example with argument unpacking

kwargs: CreateTypeRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "definition": ...,
    "format": ...,
}

parent.create_type(**kwargs)
  1. See CreateTypeRequestRequestTypeDef

delete_api_cache#

Deletes an ApiCache object.

Type annotations and code completion for boto3.client("appsync").delete_api_cache method. boto3 documentation

# delete_api_cache method definition

def delete_api_cache(
    self,
    *,
    apiId: str,
) -> Dict[str, Any]:
    ...
# delete_api_cache method usage example with argument unpacking

kwargs: DeleteApiCacheRequestRequestTypeDef = {  # (1)
    "apiId": ...,
}

parent.delete_api_cache(**kwargs)
  1. See DeleteApiCacheRequestRequestTypeDef

delete_api_key#

Deletes an API key.

Type annotations and code completion for boto3.client("appsync").delete_api_key method. boto3 documentation

# delete_api_key method definition

def delete_api_key(
    self,
    *,
    apiId: str,
    id: str,
) -> Dict[str, Any]:
    ...
# delete_api_key method usage example with argument unpacking

kwargs: DeleteApiKeyRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "id": ...,
}

parent.delete_api_key(**kwargs)
  1. See DeleteApiKeyRequestRequestTypeDef

delete_data_source#

Deletes a DataSource object.

Type annotations and code completion for boto3.client("appsync").delete_data_source method. boto3 documentation

# delete_data_source method definition

def delete_data_source(
    self,
    *,
    apiId: str,
    name: str,
) -> Dict[str, Any]:
    ...
# delete_data_source method usage example with argument unpacking

kwargs: DeleteDataSourceRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "name": ...,
}

parent.delete_data_source(**kwargs)
  1. See DeleteDataSourceRequestRequestTypeDef

delete_domain_name#

Deletes a custom DomainName object.

Type annotations and code completion for boto3.client("appsync").delete_domain_name method. boto3 documentation

# delete_domain_name method definition

def delete_domain_name(
    self,
    *,
    domainName: str,
) -> Dict[str, Any]:
    ...
# delete_domain_name method usage example with argument unpacking

kwargs: DeleteDomainNameRequestRequestTypeDef = {  # (1)
    "domainName": ...,
}

parent.delete_domain_name(**kwargs)
  1. See DeleteDomainNameRequestRequestTypeDef

delete_function#

Deletes a Function.

Type annotations and code completion for boto3.client("appsync").delete_function method. boto3 documentation

# delete_function method definition

def delete_function(
    self,
    *,
    apiId: str,
    functionId: str,
) -> Dict[str, Any]:
    ...
# delete_function method usage example with argument unpacking

kwargs: DeleteFunctionRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "functionId": ...,
}

parent.delete_function(**kwargs)
  1. See DeleteFunctionRequestRequestTypeDef

delete_graphql_api#

Deletes a GraphqlApi object.

Type annotations and code completion for boto3.client("appsync").delete_graphql_api method. boto3 documentation

# delete_graphql_api method definition

def delete_graphql_api(
    self,
    *,
    apiId: str,
) -> Dict[str, Any]:
    ...
# delete_graphql_api method usage example with argument unpacking

kwargs: DeleteGraphqlApiRequestRequestTypeDef = {  # (1)
    "apiId": ...,
}

parent.delete_graphql_api(**kwargs)
  1. See DeleteGraphqlApiRequestRequestTypeDef

delete_resolver#

Deletes a Resolver object.

Type annotations and code completion for boto3.client("appsync").delete_resolver method. boto3 documentation

# delete_resolver method definition

def delete_resolver(
    self,
    *,
    apiId: str,
    typeName: str,
    fieldName: str,
) -> Dict[str, Any]:
    ...
# delete_resolver method usage example with argument unpacking

kwargs: DeleteResolverRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "typeName": ...,
    "fieldName": ...,
}

parent.delete_resolver(**kwargs)
  1. See DeleteResolverRequestRequestTypeDef

delete_type#

Deletes a Type object.

Type annotations and code completion for boto3.client("appsync").delete_type method. boto3 documentation

# delete_type method definition

def delete_type(
    self,
    *,
    apiId: str,
    typeName: str,
) -> Dict[str, Any]:
    ...
# delete_type method usage example with argument unpacking

kwargs: DeleteTypeRequestRequestTypeDef = {  # (1)
    "apiId": ...,
    "typeName": ...,
}

parent.delete_type(**kwargs)
  1. See DeleteTypeRequestRequestTypeDef

disassociate_api#

Removes an ApiAssociation object from a custom domain.

Type annotations and code completion for boto3.client("appsync").disassociate_api method. boto3 documentation

# disassociate_api method definition

def disassociate_api(
    self,
    *,
    domainName: str,
) -> Dict[str, Any]:
    ...
# disassociate_api method usage example with argument unpacking

kwargs: DisassociateApiRequestRequestTypeDef = {  # (1)
    "domainName": ...,
}

parent.disassociate_api(**kwargs)
  1. See DisassociateApiRequestRequestTypeDef

disassociate_merged_graphql_api#

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

Type annotations and code completion for boto3.client("appsync").disassociate_merged_graphql_api method. boto3 documentation

# disassociate_merged_graphql_api method definition

def disassociate_merged_graphql_api(
    self,
    *,
    sourceApiIdentifier: str,
    associationId: str,
) -> DisassociateMergedGraphqlApiResponseTypeDef:  # (1)
    ...
  1. See DisassociateMergedGraphqlApiResponseTypeDef
# disassociate_merged_graphql_api method usage example with argument unpacking

kwargs: DisassociateMergedGraphqlApiRequestRequestTypeDef = {  # (1)
    "sourceApiIdentifier": ...,
    "associationId": ...,
}

parent.disassociate_merged_graphql_api(**kwargs)
  1. See DisassociateMergedGraphqlApiRequestRequestTypeDef

disassociate_source_graphql_api#

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

Type annotations and code completion for boto3.client("appsync").disassociate_source_graphql_api method. boto3 documentation

# disassociate_source_graphql_api method definition

def disassociate_source_graphql_api(
    self,
    *,
    mergedApiIdentifier: str,
    associationId: str,
) -> DisassociateSourceGraphqlApiResponseTypeDef:  # (1)
    ...
  1. See DisassociateSourceGraphqlApiResponseTypeDef
# disassociate_source_graphql_api method usage example with argument unpacking

kwargs: DisassociateSourceGraphqlApiRequestRequestTypeDef = {  # (1)
    "mergedApiIdentifier": ...,
    "associationId": ...,
}

parent.disassociate_source_graphql_api(**kwargs)
  1. See DisassociateSourceGraphqlApiRequestRequestTypeDef

evaluate_code#

Evaluates the given code and returns the response.

Type annotations and code completion for boto3.client("appsync").evaluate_code method. boto3 documentation

# evaluate_code method definition

def evaluate_code(
    self,
    *,
    runtime: AppSyncRuntimeTypeDef,  # (1)
    code: str,
    context: str,
    function: str = ...,
) -> EvaluateCodeResponseTypeDef:  # (2)
    ...
  1. See AppSyncRuntimeTypeDef
  2. See EvaluateCodeResponseTypeDef
# evaluate_code method usage example with argument unpacking

kwargs: EvaluateCodeRequestRequestTypeDef = {  # (1)
    "runtime": ...,
    "code": ...,
    "context": ...,
}

parent.evaluate_code(**kwargs)
  1. See EvaluateCodeRequestRequestTypeDef

evaluate_mapping_template#

Evaluates a given template and returns the response.

Type annotations and code completion for boto3.client("appsync").evaluate_mapping_template method. boto3 documentation

# evaluate_mapping_template method definition

def evaluate_mapping_template(
    self,
    *,
    template: str,
    context: str,
) -> EvaluateMappingTemplateResponseTypeDef:  # (1)
    ...
  1. See EvaluateMappingTemplateResponseTypeDef
# evaluate_mapping_template method usage example with argument unpacking

kwargs: EvaluateMappingTemplateRequestRequestTypeDef = {  # (1)
    "template": ...,
    "context": ...,
}

parent.evaluate_mapping_template(**kwargs)
  1. See EvaluateMappingTemplateRequestRequestTypeDef

flush_api_cache#

Flushes an ApiCache object.

Type annotations and code completion for boto3.client("appsync").flush_api_cache method.