Skip to content

update_graphql_api

update_graphql_api(
    api_id: String,
    name: String,
    authentication_type: AuthenticationType,
    *,
    config_overrides: Optional[AppSyncClientConfig] = None,
    log_config: Optional[LogConfig] = None,
    user_pool_config: Optional[UserPoolConfig] = None,
    open_id_connect_config: Optional[OpenIDConnectConfig] = None,
    additional_authentication_providers: Optional[
        AdditionalAuthenticationProviders
    ] = None,
    xray_enabled: Optional[Boolean] = None,
    lambda_authorizer_config: Optional[LambdaAuthorizerConfig] = None,
    merged_api_execution_role_arn: Optional[String] = None,
    owner_contact: Optional[String] = None,
    introspection_config: Optional[GraphQLApiIntrospectionConfig] = None,
    query_depth_limit: Optional[QueryDepthLimit] = None,
    resolver_count_limit: Optional[ResolverCountLimit] = None,
    enhanced_metrics_config: Optional[EnhancedMetricsConfig] = None,
) -> UpdateGraphqlApiResponse

Updates a GraphqlApi object.

Parameters:

  • api_id (String) –

    The API ID.

  • name (String) –

    The new name for the GraphqlApi object.

  • log_config (Optional[LogConfig], default: None ) –

    The Amazon CloudWatch Logs configuration for the GraphqlApi object.

  • authentication_type (AuthenticationType) –

    The new authentication type for the GraphqlApi object.

  • user_pool_config (Optional[UserPoolConfig], default: None ) –

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

  • open_id_connect_config (Optional[OpenIDConnectConfig], default: None ) –

    The OpenID Connect configuration for the GraphqlApi object.

  • additional_authentication_providers (Optional[AdditionalAuthenticationProviders], default: None ) –

    A list of additional authentication providers for the GraphqlApi API.

  • xray_enabled (Optional[Boolean], default: None ) –

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

  • lambda_authorizer_config (Optional[LambdaAuthorizerConfig], default: None ) –

    Configuration for Lambda function authorization.

  • merged_api_execution_role_arn (Optional[String], default: None ) –

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

  • owner_contact (Optional[String], default: None ) –

    The owner contact information for an API resource.

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

  • introspection_config (Optional[GraphQLApiIntrospectionConfig], default: None ) –

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

    For more information about introspection, see GraphQL introspection.

  • query_depth_limit (Optional[QueryDepthLimit], default: None ) –

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

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

  • resolver_count_limit (Optional[ResolverCountLimit], default: None ) –

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

  • enhanced_metrics_config (Optional[EnhancedMetricsConfig], default: None ) –

    The enhancedMetricsConfig object.

Raises:

  • AccessDeniedException –

    You don't have access to perform this operation on this resource.

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.

  • ConcurrentModificationException –

    Another modification is in progress at this time and it must complete before you can make your change.

  • InternalFailureException –

    An internal AppSync error occurred. Try your request again.

  • NotFoundException –

    The resource specified in the request was not found. Check the resource, and then try again.

  • UnauthorizedException –

    You aren't authorized to perform this operation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appsync/_services/app_sync.py
def update_graphql_api(
    self,
    api_id: "capo_appsync.types.string.String",
    name: "capo_appsync.types.string.String",
    authentication_type: "capo_appsync.types.authentication_type.AuthenticationType",
    *,
    config_overrides: Optional[AppSyncClientConfig] = None,
    log_config: Optional["capo_appsync.types.log_config.LogConfig"] = None,
    user_pool_config: Optional[
        "capo_appsync.types.user_pool_config.UserPoolConfig"
    ] = None,
    open_id_connect_config: Optional[
        "capo_appsync.types.open_id_connect_config.OpenIDConnectConfig"
    ] = None,
    additional_authentication_providers: Optional[
        "capo_appsync.types.additional_authentication_providers.AdditionalAuthenticationProviders"
    ] = None,
    xray_enabled: Optional["capo_appsync.types.boolean.Boolean"] = None,
    lambda_authorizer_config: Optional[
        "capo_appsync.types.lambda_authorizer_config.LambdaAuthorizerConfig"
    ] = None,
    merged_api_execution_role_arn: Optional[
        "capo_appsync.types.string.String"
    ] = None,
    owner_contact: Optional["capo_appsync.types.string.String"] = None,
    introspection_config: Optional[
        "capo_appsync.types.graph_ql_api_introspection_config.GraphQLApiIntrospectionConfig"
    ] = None,
    query_depth_limit: Optional[
        "capo_appsync.types.query_depth_limit.QueryDepthLimit"
    ] = None,
    resolver_count_limit: Optional[
        "capo_appsync.types.resolver_count_limit.ResolverCountLimit"
    ] = None,
    enhanced_metrics_config: Optional[
        "capo_appsync.types.enhanced_metrics_config.EnhancedMetricsConfig"
    ] = None,
) -> "capo_appsync.types.update_graphql_api_response.UpdateGraphqlApiResponse":
    """<p>Updates a <code>GraphqlApi</code> object.</p>

    Args:
        api_id: <p>The API ID.</p>
        name: <p>The new name for the <code>GraphqlApi</code> object.</p>
        log_config: <p>The Amazon CloudWatch Logs configuration for the <code>GraphqlApi</code> object.</p>
        authentication_type: <p>The new authentication type for the <code>GraphqlApi</code> object.</p>
        user_pool_config: <p>The new Amazon Cognito user pool configuration for the <code>~GraphqlApi</code> object.</p>
        open_id_connect_config: <p>The OpenID Connect configuration for the <code>GraphqlApi</code> object.</p>
        additional_authentication_providers: <p>A list of additional authentication providers for the <code>GraphqlApi</code> API.</p>
        xray_enabled: <p>A flag indicating whether to use X-Ray tracing for the <code>GraphqlApi</code>.</p>
        lambda_authorizer_config: <p>Configuration for Lambda function authorization.</p>
        merged_api_execution_role_arn: <p>The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the source API changes automatically.</p>
        owner_contact: <p>The owner contact information for an API resource.</p> <p>This field accepts any string input with a length of 0 - 256 characters.</p>
        introspection_config: <p>Sets the value of the GraphQL API to enable (<code>ENABLED</code>) or disable (<code>DISABLED</code>) introspection. If no value is provided, the introspection configuration will be set to <code>ENABLED</code> by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled.</p> <p>For more information about introspection, see <a href="https://graphql.org/learn/introspection/">GraphQL introspection</a>.</p>
        query_depth_limit: <p>The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is <code>0</code> (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between <code>1</code> and <code>75</code> nested levels. This field will produce a limit error if the operation falls out of bounds.</p> <p>Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.</p>
        resolver_count_limit: <p>The maximum number of resolvers that can be invoked in a single request. The default value is <code>0</code> (or unspecified), which will set the limit to <code>10000</code>. When specified, the limit value can be between <code>1</code> and <code>10000</code>. This field will produce a limit error if the operation falls out of bounds.</p>
        enhanced_metrics_config: <p>The <code>enhancedMetricsConfig</code> object.</p>

    Raises:
        capo_appsync.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to perform this operation on this resource.</p>
        capo_appsync.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.</p>
        capo_appsync.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Another modification is in progress at this time and it must complete before you can make your change.</p>
        capo_appsync.errors.internal_failure_exception.InternalFailureException: <p>An internal AppSync error occurred. Try your request again.</p>
        capo_appsync.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. Check the resource, and then try again.</p>
        capo_appsync.errors.unauthorized_exception.UnauthorizedException: <p>You aren't authorized to perform this operation.</p>
        capo_appsync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appsync.types.update_graphql_api_request.UpdateGraphqlApiRequest]",
    ) -> OperationResponse[
        "capo_appsync.types.update_graphql_api_response.UpdateGraphqlApiResponse"
    ]:
        import capo_appsync._operations.aws_deepdish_control_plane_service.update_graphql_api

        output, http_response = (
            capo_appsync._operations.aws_deepdish_control_plane_service.update_graphql_api.update_graphql_api(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateGraphqlApi")
    )
    input_: capo_appsync.types.update_graphql_api_request.UpdateGraphqlApiRequest = {
        "api_id": api_id,
        "name": name,
        "authentication_type": authentication_type,
    }
    if log_config is not None:
        input_["log_config"] = log_config
    if user_pool_config is not None:
        input_["user_pool_config"] = user_pool_config
    if open_id_connect_config is not None:
        input_["open_id_connect_config"] = open_id_connect_config
    if additional_authentication_providers is not None:
        input_["additional_authentication_providers"] = (
            additional_authentication_providers
        )
    if xray_enabled is not None:
        input_["xray_enabled"] = xray_enabled
    if lambda_authorizer_config is not None:
        input_["lambda_authorizer_config"] = lambda_authorizer_config
    if merged_api_execution_role_arn is not None:
        input_["merged_api_execution_role_arn"] = merged_api_execution_role_arn
    if owner_contact is not None:
        input_["owner_contact"] = owner_contact
    if introspection_config is not None:
        input_["introspection_config"] = introspection_config
    if query_depth_limit is not None:
        input_["query_depth_limit"] = query_depth_limit
    if resolver_count_limit is not None:
        input_["resolver_count_limit"] = resolver_count_limit
    if enhanced_metrics_config is not None:
        input_["enhanced_metrics_config"] = enhanced_metrics_config

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output