diff --git a/README.md b/README.md
index 05d503e375..18cc8e7f34 100644
--- a/README.md
+++ b/README.md
@@ -189,7 +189,7 @@ flowchart LR
Router["HTTP Router\nJAX-RS / Vert.x"]
subgraph Stateless ["Stateless Services"]
- A["SSM · SQS · SNS\nIAM · STS · KMS\nSecrets Manager · SES\nCognito · Kinesis\nEventBridge · Scheduler · AppConfig\nCloudWatch · Step Functions\nCloudFormation · ACM · Config\nAPI Gateway · ELB v2 · Auto Scaling\nCodeDeploy · Backup · Bedrock Runtime · Route53 · Transfer"]
+ A["SSM · SQS · SNS\nIAM · STS · KMS\nSecrets Manager · SES\nCognito · Kinesis\nEventBridge · Scheduler · AppConfig\nCloudWatch · Step Functions\nCloudFormation · ACM · Config\nAPI Gateway · AppSync · ELB v2 · Auto Scaling\nCodeDeploy · Backup · Bedrock Runtime · Route53 · Transfer"]
end
subgraph Stateful ["Stateful Services"]
@@ -220,7 +220,7 @@ Floci supports local emulation for application services, data services, eventing
|---|---|
| Core app services | S3, SQS, SNS, DynamoDB, Lambda, IAM, STS, KMS, Secrets Manager |
| Events and workflows | EventBridge, EventBridge Pipes, EventBridge Scheduler, Step Functions, CloudWatch Logs, CloudWatch Metrics |
-| API and identity | API Gateway REST, API Gateway v2, Cognito, ACM, Route53 |
+| API and identity | API Gateway REST, API Gateway v2, AppSync, Cognito, ACM, Route53 |
| Containers and compute | ECS, EC2, EKS, CodeBuild, CodeDeploy, Auto Scaling, ELB v2 |
| Graph database | Neptune |
| Data and analytics | Athena, Glue, Firehose, OpenSearch, Textract |
@@ -245,6 +245,7 @@ For operation-level compatibility, see the [Services Overview](https://floci.io/
| Lambda | Real Docker | Runtime environment, execution model, warm container pool, aliases, Function URLs |
| API Gateway REST | In-process | Resources, methods, stages, Lambda proxy, MOCK integrations, AWS integrations |
| API Gateway v2 | In-process | HTTP APIs, routes, integrations, JWT authorizers, stages |
+| AppSync | In-process | GraphQL API management API, schema registry, AWS scalars, domain names, channel namespaces |
| IAM | In-process | Users, roles, groups, policies, instance profiles, access keys |
| STS | In-process | AssumeRole, WebIdentity, SAML, GetFederationToken, GetSessionToken |
| Cognito | In-process | User pools, app clients, auth flows, JWKS and OpenID well-known endpoints |
diff --git a/compatibility-tests/sdk-test-java/README.md b/compatibility-tests/sdk-test-java/README.md
index 48f95a25c3..7a43de1c90 100644
--- a/compatibility-tests/sdk-test-java/README.md
+++ b/compatibility-tests/sdk-test-java/README.md
@@ -2,7 +2,7 @@
Compatibility tests for [Floci](https://github.com/hectorvent/floci) using the **AWS SDK for Java v2 (2.31.8)**.
-Runs 313 tests across 16 test classes against a live Floci instance — no mocks.
+Runs 352 tests across 17 test classes against a live Floci instance — no mocks.
## Services Covered
@@ -24,6 +24,7 @@ Runs 313 tests across 16 test classes against a live Floci instance — no mocks
| `ApigwSfnJsonataCrudlTests` | API Gateway + Step Functions JSONata CRUDL integration |
| `ApiGatewayV2WebSocketAndExtendedOpsTest` | API GW v2 WebSocket APIs, Update ops, Route/Integration Responses, Models, Tagging |
| `Ec2Tests` | EC2 instances, VPCs, security groups, subnets |
+| `AppSyncTest` | GraphQL API CRUDL, data sources, resolvers, functions, types, API keys, tags, schema validation |
| `EcsTests` | ECS clusters, task definitions, services |
## Adding a New Test
diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AppSyncTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AppSyncTest.java
index 0cdbd034bb..f67b893e11 100644
--- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AppSyncTest.java
+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AppSyncTest.java
@@ -487,6 +487,394 @@ class AppSyncTest {
assertThat(resp).isNotNull();
}
+ // ── Phase 2: Model Compatibility ───────────────────────────────────
+
+ @Test
+ @Order(90)
+ void createDataSource_hasDataSourceArn() {
+ CreateDataSourceResponse resp = client.createDataSource(CreateDataSourceRequest.builder()
+ .apiId(apiId)
+ .name("arn-check-ds")
+ .type("NONE")
+ .build());
+
+ assertThat(resp.dataSource().dataSourceArn()).isNotNull();
+ assertThat(resp.dataSource().dataSourceArn()).contains("arn:aws:appsync:");
+ assertThat(resp.dataSource().dataSourceArn()).contains("/datasources/arn-check-ds");
+
+ client.deleteDataSource(r -> r.apiId(apiId).name("arn-check-ds"));
+ }
+
+ @Test
+ @Order(91)
+ void createResolver_hasResolverArn() {
+ CreateResolverResponse resp = client.createResolver(CreateResolverRequest.builder()
+ .apiId(apiId)
+ .typeName("Query")
+ .fieldName("resolverArnCheck")
+ .dataSourceName("none-ds")
+ .build());
+
+ assertThat(resp.resolver().resolverArn()).isNotNull();
+ assertThat(resp.resolver().resolverArn()).contains("arn:aws:appsync:");
+ assertThat(resp.resolver().resolverArn()).contains("/types/Query/resolvers/resolverArnCheck");
+
+ client.deleteResolver(r -> r.apiId(apiId).typeName("Query").fieldName("resolverArnCheck"));
+ }
+
+ @Test
+ @Order(92)
+ void createFunction_hasFunctionArn() {
+ CreateFunctionResponse resp = client.createFunction(CreateFunctionRequest.builder()
+ .apiId(apiId)
+ .name("arn-check-fn")
+ .dataSourceName("none-ds")
+ .build());
+
+ assertThat(resp.functionConfiguration().functionArn()).isNotNull();
+ assertThat(resp.functionConfiguration().functionArn()).contains("arn:aws:appsync:");
+
+ client.deleteFunction(r -> r.apiId(apiId).functionId(resp.functionConfiguration().functionId()));
+ }
+
+ @Test
+ @Order(93)
+ void startSchemaCreation_invalidSchema() {
+ assertThatThrownBy(() -> client.startSchemaCreation(StartSchemaCreationRequest.builder()
+ .apiId(apiId)
+ .definition(SdkBytes.fromUtf8String("type Query { invalid !!! }"))
+ .build()))
+ .isInstanceOf(AppSyncException.class)
+ .hasMessageContaining("Invalid schema");
+ }
+
+ @Test
+ @Order(94)
+ void startSchemaCreation_withAWSScalars() {
+ StartSchemaCreationResponse resp = client.startSchemaCreation(
+ StartSchemaCreationRequest.builder()
+ .apiId(apiId)
+ .definition(SdkBytes.fromUtf8String(
+ "type Query { now: AWSDateTime, data: AWSJSON, ip: AWSIPAddress, active: AWSBoolean }"))
+ .build());
+
+ assertThat(resp.status()).isNotNull();
+ }
+
+ // ── Channel Namespaces ─────────────────────────────────────────────
+
+ private static String channelNsName;
+
+ @Test
+ @Order(95)
+ void createChannelNamespace() {
+ CreateChannelNamespaceResponse resp = client.createChannelNamespace(
+ CreateChannelNamespaceRequest.builder()
+ .apiId(apiId)
+ .name("sdk-channel-ns")
+ .build());
+
+ assertThat(resp.channelNamespace()).isNotNull();
+ channelNsName = resp.channelNamespace().name();
+ assertThat(channelNsName).isEqualTo("sdk-channel-ns");
+ assertThat(resp.channelNamespace().apiId()).isEqualTo(apiId);
+ }
+
+ @Test
+ @Order(96)
+ void getChannelNamespace() {
+ GetChannelNamespaceResponse resp = client.getChannelNamespace(
+ GetChannelNamespaceRequest.builder()
+ .apiId(apiId)
+ .name(channelNsName)
+ .build());
+
+ assertThat(resp.channelNamespace()).isNotNull();
+ assertThat(resp.channelNamespace().name()).isEqualTo(channelNsName);
+ }
+
+ @Test
+ @Order(97)
+ void updateChannelNamespace() {
+ UpdateChannelNamespaceResponse resp = client.updateChannelNamespace(
+ UpdateChannelNamespaceRequest.builder()
+ .apiId(apiId)
+ .name(channelNsName)
+ .build());
+
+ assertThat(resp.channelNamespace()).isNotNull();
+ }
+
+ @Test
+ @Order(98)
+ void listChannelNamespaces() {
+ ListChannelNamespacesResponse resp = client.listChannelNamespaces(
+ ListChannelNamespacesRequest.builder()
+ .apiId(apiId)
+ .build());
+
+ assertThat(resp.channelNamespaces()).isNotEmpty();
+ }
+
+ @Test
+ @Order(99)
+ void deleteChannelNamespace() {
+ DeleteChannelNamespaceResponse resp = client.deleteChannelNamespace(
+ DeleteChannelNamespaceRequest.builder()
+ .apiId(apiId)
+ .name(channelNsName)
+ .build());
+
+ assertThat(resp).isNotNull();
+ }
+
+ // ── Domain Association ─────────────────────────────────────────────
+
+ private static String tempDomainName;
+
+ @Test
+ @Order(100)
+ void createDomainName() {
+ // Use unique domain name to avoid conflicts
+ String domainSuffix = java.util.UUID.randomUUID().toString().substring(0, 8);
+ CreateDomainNameResponse resp = client.createDomainName(
+ CreateDomainNameRequest.builder()
+ .domainName("sdk-" + domainSuffix + ".example.com")
+ .certificateArn("arn:aws:acm:us-east-1:000000000000:certificate/sdk")
+ .build());
+
+ assertThat(resp.domainNameConfig()).isNotNull();
+ tempDomainName = resp.domainNameConfig().domainName();
+ assertThat(tempDomainName).startsWith("sdk-");
+ assertThat(resp.domainNameConfig().appsyncDomainName()).isNotNull();
+ }
+
+ @Test
+ @Order(101)
+ void getDomainName() {
+ GetDomainNameResponse resp = client.getDomainName(
+ GetDomainNameRequest.builder()
+ .domainName(tempDomainName)
+ .build());
+
+ assertThat(resp.domainNameConfig()).isNotNull();
+ assertThat(resp.domainNameConfig().domainName()).isEqualTo(tempDomainName);
+ }
+
+ @Test
+ @Order(102)
+ void updateDomainName() {
+ UpdateDomainNameResponse resp = client.updateDomainName(
+ UpdateDomainNameRequest.builder()
+ .domainName(tempDomainName)
+ .description("updated-domain")
+ .build());
+
+ assertThat(resp.domainNameConfig()).isNotNull();
+ assertThat(resp.domainNameConfig().domainName()).isEqualTo(tempDomainName);
+ }
+
+ @Test
+ @Order(103)
+ void associateApi() {
+ AssociateApiResponse resp = client.associateApi(
+ AssociateApiRequest.builder()
+ .domainName(tempDomainName)
+ .apiId(apiId)
+ .build());
+
+ assertThat(resp.apiAssociation()).isNotNull();
+ assertThat(resp.apiAssociation().domainName()).isEqualTo(tempDomainName);
+ assertThat(resp.apiAssociation().apiId()).isEqualTo(apiId);
+ }
+
+ @Test
+ @Order(104)
+ void getApiAssociation() {
+ GetApiAssociationResponse resp = client.getApiAssociation(
+ GetApiAssociationRequest.builder()
+ .domainName(tempDomainName)
+ .build());
+
+ assertThat(resp.apiAssociation()).isNotNull();
+ assertThat(resp.apiAssociation().apiId()).isEqualTo(apiId);
+ }
+
+ @Test
+ @Order(105)
+ void disassociateApi() {
+ DisassociateApiResponse resp = client.disassociateApi(
+ DisassociateApiRequest.builder()
+ .domainName(tempDomainName)
+ .build());
+
+ assertThat(resp).isNotNull();
+ }
+
+ @Test
+ @Order(106)
+ void deleteDomainName() {
+ DeleteDomainNameResponse resp = client.deleteDomainName(
+ DeleteDomainNameRequest.builder()
+ .domainName(tempDomainName)
+ .build());
+
+ assertThat(resp).isNotNull();
+ }
+
+ // ── Source API Association ─────────────────────────────────────────
+
+ private static String sourceApiId;
+ private static String assocId;
+
+ @Test
+ @Order(107)
+ void associateSourceGraphqlApi() {
+ // Create source API
+ CreateGraphqlApiResponse sourceResp = client.createGraphqlApi(
+ CreateGraphqlApiRequest.builder()
+ .name("sdk-source-api")
+ .authenticationType("API_KEY")
+ .build());
+ sourceApiId = sourceResp.graphqlApi().apiId();
+
+ AssociateSourceGraphqlApiResponse resp = client.associateSourceGraphqlApi(
+ AssociateSourceGraphqlApiRequest.builder()
+ .mergedApiIdentifier(apiId)
+ .sourceApiIdentifier(sourceApiId)
+ .build());
+
+ assertThat(resp.sourceApiAssociation()).isNotNull();
+ assocId = resp.sourceApiAssociation().associationId();
+ assertThat(assocId).isNotNull();
+ assertThat(resp.sourceApiAssociation().sourceApiId()).isEqualTo(sourceApiId);
+ }
+
+ @Test
+ @Order(108)
+ void getSourceApiAssociation() {
+ GetSourceApiAssociationResponse resp = client.getSourceApiAssociation(
+ GetSourceApiAssociationRequest.builder()
+ .mergedApiIdentifier(apiId)
+ .associationId(assocId)
+ .build());
+
+ assertThat(resp.sourceApiAssociation()).isNotNull();
+ assertThat(resp.sourceApiAssociation().associationId()).isEqualTo(assocId);
+ assertThat(resp.sourceApiAssociation().sourceApiId()).isEqualTo(sourceApiId);
+ }
+
+ @Test
+ @Order(109)
+ void listSourceApiAssociations() {
+ ListSourceApiAssociationsResponse resp = client.listSourceApiAssociations(
+ ListSourceApiAssociationsRequest.builder()
+ .apiId(apiId)
+ .build());
+
+ assertThat(resp.sourceApiAssociationSummaries()).isNotEmpty();
+ }
+
+ @Test
+ @Order(110)
+ void disassociateSourceGraphqlApi() {
+ DisassociateSourceGraphqlApiResponse resp = client.disassociateSourceGraphqlApi(
+ DisassociateSourceGraphqlApiRequest.builder()
+ .mergedApiIdentifier(apiId)
+ .associationId(assocId)
+ .build());
+
+ assertThat(resp).isNotNull();
+ }
+
+ @Test
+ @Order(111)
+ void cleanupSourceApi() {
+ client.deleteGraphqlApi(DeleteGraphqlApiRequest.builder()
+ .apiId(sourceApiId)
+ .build());
+ }
+
+ // ── Merged API Associations ────────────────────────────────────────
+
+ private static String mergedAssocSourceApiId;
+ private static String mergedAssocId;
+
+ @Test
+ @Order(112)
+ void associateMergedGraphqlApi() {
+ CreateGraphqlApiResponse sourceResp = client.createGraphqlApi(
+ CreateGraphqlApiRequest.builder()
+ .name("sdk-merged-source")
+ .authenticationType("API_KEY")
+ .build());
+ mergedAssocSourceApiId = sourceResp.graphqlApi().apiId();
+
+ AssociateMergedGraphqlApiResponse resp = client.associateMergedGraphqlApi(
+ AssociateMergedGraphqlApiRequest.builder()
+ .sourceApiIdentifier(mergedAssocSourceApiId)
+ .mergedApiIdentifier(apiId)
+ .build());
+
+ assertThat(resp.sourceApiAssociation()).isNotNull();
+ mergedAssocId = resp.sourceApiAssociation().associationId();
+ assertThat(mergedAssocId).isNotNull();
+ assertThat(resp.sourceApiAssociation().sourceApiId()).isEqualTo(mergedAssocSourceApiId);
+ assertThat(resp.sourceApiAssociation().mergedApiId()).isEqualTo(apiId);
+ }
+
+ @Test
+ @Order(113)
+ void updateSourceApiAssociation() {
+ CreateGraphqlApiResponse updateSourceResp = client.createGraphqlApi(
+ CreateGraphqlApiRequest.builder()
+ .name("sdk-update-source")
+ .authenticationType("API_KEY")
+ .build());
+ String updateSourceApiId = updateSourceResp.graphqlApi().apiId();
+
+ AssociateSourceGraphqlApiResponse assocResp = client.associateSourceGraphqlApi(
+ AssociateSourceGraphqlApiRequest.builder()
+ .mergedApiIdentifier(apiId)
+ .sourceApiIdentifier(updateSourceApiId)
+ .build());
+ String updateAssocId = assocResp.sourceApiAssociation().associationId();
+
+ UpdateSourceApiAssociationResponse resp = client.updateSourceApiAssociation(
+ UpdateSourceApiAssociationRequest.builder()
+ .mergedApiIdentifier(apiId)
+ .associationId(updateAssocId)
+ .description("updated-association")
+ .build());
+
+ assertThat(resp.sourceApiAssociation()).isNotNull();
+ assertThat(resp.sourceApiAssociation().associationId()).isEqualTo(updateAssocId);
+ assertThat(resp.sourceApiAssociation().description()).isEqualTo("updated-association");
+
+ client.deleteGraphqlApi(DeleteGraphqlApiRequest.builder().apiId(updateSourceApiId).build());
+ }
+
+ @Test
+ @Order(114)
+ void disassociateMergedGraphqlApi() {
+ DisassociateMergedGraphqlApiResponse resp = client.disassociateMergedGraphqlApi(
+ DisassociateMergedGraphqlApiRequest.builder()
+ .sourceApiIdentifier(mergedAssocSourceApiId)
+ .associationId(mergedAssocId)
+ .build());
+
+ assertThat(resp).isNotNull();
+ assertThat(resp.sourceApiAssociationStatus()).isNotNull();
+ }
+
+ @Test
+ @Order(115)
+ void cleanupMergedSourceApi() {
+ client.deleteGraphqlApi(DeleteGraphqlApiRequest.builder()
+ .apiId(mergedAssocSourceApiId)
+ .build());
+ }
+
// ── Error Handling ─────────────────────────────────────────────────
@Test
diff --git a/docs/configuration/advanced/application-yml.md b/docs/configuration/advanced/application-yml.md
index d4fdf3f21a..ebb2b7c8aa 100644
--- a/docs/configuration/advanced/application-yml.md
+++ b/docs/configuration/advanced/application-yml.md
@@ -216,6 +216,9 @@ floci:
enabled: true
mock: false # true = tasks go to RUNNING without Docker (useful for CI)
+ appsync:
+ enabled: true
+
appconfig:
enabled: true
diff --git a/docs/configuration/environment-variables.md b/docs/configuration/environment-variables.md
index ded893c80c..94c7db6870 100644
--- a/docs/configuration/environment-variables.md
+++ b/docs/configuration/environment-variables.md
@@ -405,6 +405,7 @@ These services spawn Docker containers. They require access to the Docker socket
| Variable | Default | Description |
|---|---|---|
| `FLOCI_SERVICES_GLUE_ENABLED` | `true` | Enable the Glue service |
+| `FLOCI_SERVICES_APPSYNC_ENABLED` | `true` | Enable the AppSync service |
| `FLOCI_SERVICES_BEDROCK_RUNTIME_ENABLED` | `true` | Enable the Bedrock Runtime service |
| `FLOCI_SERVICES_TEXTRACT_ENABLED` | `true` | Enable the Textract service |
| `FLOCI_SERVICES_TRANSFER_ENABLED` | `true` | Enable the Transfer Family service |
diff --git a/docs/configuration/storage.md b/docs/configuration/storage.md
index fce4a1a009..240905da0f 100644
--- a/docs/configuration/storage.md
+++ b/docs/configuration/storage.md
@@ -46,6 +46,8 @@ When not set for a service, it inherits `FLOCI_STORAGE_MODE`. Only override when
| `FLOCI_STORAGE_SERVICES_SECRETSMANAGER_FLUSH_INTERVAL_MS` | `5000` | Secrets Manager flush interval (ms) |
| `FLOCI_STORAGE_SERVICES_ACM_MODE` | global default | ACM storage mode |
| `FLOCI_STORAGE_SERVICES_ACM_FLUSH_INTERVAL_MS` | `5000` | ACM flush interval (ms) |
+| `FLOCI_STORAGE_SERVICES_APPSYNC_MODE` | global default | AppSync storage mode |
+| `FLOCI_STORAGE_SERVICES_APPSYNC_FLUSH_INTERVAL_MS` | `5000` | AppSync flush interval (ms) |
| `FLOCI_STORAGE_SERVICES_OPENSEARCH_MODE` | global default | OpenSearch storage mode |
| `FLOCI_STORAGE_SERVICES_OPENSEARCH_FLUSH_INTERVAL_MS` | `5000` | OpenSearch flush interval (ms) |
| `FLOCI_STORAGE_SERVICES_RDS_MODE` | global default | RDS metadata storage mode (see note below) |
diff --git a/docs/index.md b/docs/index.md
index 1f51fe13cf..3682d752ef 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -12,7 +12,7 @@ Floci is a fast, free, and open-source local AWS service emulator built for deve
## Supported Services
-Floci emulates 51 AWS services. See the [Services Overview](services/index.md) for per-service operation counts, endpoints, and full protocol details.
+Floci emulates 52 AWS services. See the [Services Overview](services/index.md) for per-service operation counts, endpoints, and full protocol details.
| Service | Protocol |
|---|---|
@@ -25,6 +25,7 @@ Floci emulates 51 AWS services. See the [Services Overview](services/index.md) f
| DynamoDB + Streams | JSON 1.1 |
| Lambda | REST JSON |
| API Gateway v1 & v2 | REST JSON |
+| AppSync | REST JSON |
| Cognito | JSON 1.1 |
| KMS | JSON 1.1 |
| Kinesis | JSON 1.1 |
diff --git a/docs/services/appsync.md b/docs/services/appsync.md
index 2143ca3285..73e445088a 100644
--- a/docs/services/appsync.md
+++ b/docs/services/appsync.md
@@ -3,7 +3,7 @@
**Protocol:** REST JSON
**Endpoint:** `http://localhost:4566/v1/apis/...`
-Floci implements the AWS AppSync Management API, providing local emulation of GraphQL API configuration, schema management, data source binding, resolver mapping, and API key provisioning.
+Floci implements the AWS AppSync Management API, providing local emulation of GraphQL API configuration, schema management, data source binding, resolver mapping, API key provisioning, custom domains, and channel namespaces.
## Supported Operations
@@ -21,7 +21,7 @@ Floci implements the AWS AppSync Management API, providing local emulation of Gr
| Operation | Description |
|---|---|
-| `StartSchemaCreation` | Start schema creation (always synchronous) |
+| `StartSchemaCreation` | Start schema creation — validates and parses SDL using graphql-java (invalid SDL returns 400) |
| `GetSchemaCreationStatus` | Get schema creation status |
| `GetIntrospectionSchema` | Get the introspection schema |
@@ -92,6 +92,88 @@ Floci implements the AWS AppSync Management API, providing local emulation of Gr
| `GetEnvironmentVariables` | Get environment variables for an API |
| `PutEnvironmentVariables` | Set environment variables for an API |
+### Domain Names
+
+| Operation | Description |
+|---|---|
+| `CreateDomainName` | Register a custom domain name |
+| `GetDomainName` | Get domain name configuration |
+| `UpdateDomainName` | Update domain name description |
+| `ListDomainNames` | List all domain names |
+| `DeleteDomainName` | Delete a custom domain name |
+| `AssociateApi` | Associate a domain name with a GraphQL API |
+| `GetAssociatedApi` | Get the API associated with a domain name |
+| `DisassociateApi` | Disassociate a domain name from a GraphQL API |
+| `ListApiAssociations` | List all associations for an API |
+
+### Channel Namespaces
+
+| Operation | Description |
+|---|---|
+| `CreateChannelNamespace` | Create a channel namespace |
+| `GetChannelNamespace` | Get a channel namespace by name |
+| `UpdateChannelNamespace` | Update a channel namespace description |
+| `ListChannelNamespaces` | List all channel namespaces for an API |
+| `DeleteChannelNamespace` | Delete a channel namespace |
+
+### Merged API Associations
+
+| Operation | Description |
+|---|---|
+| `CreateApiAssociation` | Associate a source API with a merged API |
+| `GetApiAssociation` | Get a merged API association |
+| `DeleteApiAssociation` | Delete a merged API association |
+| `ListApiAssociations` | List all merged API associations |
+
+### Enhanced Metrics
+
+| Operation | Description |
+|---|---|
+| `GetEnhancedMetricsConfig` | Get the enhanced metrics configuration |
+
+## Schema Registry
+
+`StartSchemaCreation` validates the provided GraphQL SDL using [graphql-java](https://github.com/graphql-java/graphql-java). Invalid schemas are rejected with a `BadRequestException` (400) at registration time, preventing them from being caught later during query execution.
+
+The following **AWS scalar types** are pre-registered and available in any schema without requiring explicit `scalar` declarations:
+
+| Scalar | Java Type | Validation |
+|--------|-----------|------------|
+| `AWSJSON` | String | Valid JSON syntax |
+| `AWSDateTime` | String | ISO 8601 datetime |
+| `AWSDate` | String | ISO 8601 date (yyyy-MM-dd) |
+| `AWSTime` | String | ISO 8601 time |
+| `AWSTimestamp` | Long | Unix epoch seconds (0 to 32503680000) |
+| `AWSEmail` | String | RFC 5322 email format |
+| `AWSURL` | String | Valid URL |
+| `AWSPhone` | String | E.164 format (+1234567890) |
+| `AWSIPAddress` | String | IPv4 or IPv6 |
+| `AWSBoolean` | Boolean | Boolean value |
+| `AWSLong` | Long | 64-bit signed integer |
+| `AWSInteger` | Integer | 32-bit signed integer |
+| `AWSShort` | Integer | 16-bit signed integer (-32768 to 32767) |
+| `AWSFloat` | Double | IEEE 754 double-precision |
+| `AWSBigDecimal` | String | Arbitrary-precision decimal |
+| `AWSBigInt` | String | Arbitrary-precision integer |
+| `AWSByte` | String | Base64-encoded byte array |
+
+The following **AppSync directives** are pre-defined and recognized in schemas:
+
+| Directive | Locations | Purpose |
+|-----------|-----------|---------|
+| `@aws_api_key` | OBJECT, FIELD_DEFINITION | Require API key auth |
+| `@aws_iam` | OBJECT, FIELD_DEFINITION | Require IAM auth |
+| `@aws_cognito_user_pools(cognito_groups: [String!]!)` | OBJECT, FIELD_DEFINITION | Require Cognito user pool auth |
+| `@aws_oidc` | OBJECT, FIELD_DEFINITION | Require OIDC auth |
+| `@aws_lambda` | OBJECT, FIELD_DEFINITION | Require Lambda auth |
+| `@aws_subscribe(mutations: [String!]!)` | FIELD_DEFINITION | Link subscription to mutation |
+| `@aws_auth(cognito_groups: [String!]!)` | OBJECT | Require Cognito groups |
+| `@aws_delta_sync` | OBJECT | Delta sync configuration |
+
+Unknown directives are rejected during schema registration.
+
+Schema extensions (`extend type Query { ... }`) are supported natively through graphql-java.
+
## Pagination
All `List` operations support cursor-based pagination via query parameters:
@@ -126,18 +208,24 @@ Deleting a GraphQL API (`DeleteGraphqlApi`) automatically deletes all child reso
- All functions
- All types
- All API keys
+- All channel namespaces
+- All domain name associations
This matches AWS behavior where deleting an API removes its entire configuration.
## Not Implemented
-These AWS AppSync operations are not yet implemented:
+These AWS AppSync operations are not yet implemented and are tracked in future phases:
-- Real-time subscriptions (WebSocket)
-- Pipeline resolvers
-- Custom domain names
-- Additional authentication providers management
-- Data source service role validation
+- **Execution engine** (Phase 5): GraphQL query execution, resolver dispatch, VTL template evaluation
+- **Data source adapters** (Phase 7): DynamoDB, Lambda, HTTP, EventBridge, OpenSearch, RDS connectors
+- **Pipeline resolvers** (Phase 8): Function chaining with `$prev` and `$stash`
+- **Subscriptions** (Phase 9): WebSocket real-time subscriptions
+- **Caching** (Phase 10): API-level and per-resolver caching
+- **Authentication** (Phase 4): API key validation on the GraphQL endpoint
+- **Introspection** (Phase 6): `__schema` and `__type` queries
+- **Merged API source management**: `AssociateMergedGraphqlApi`, `AssociateSourceGraphqlApi`, `StartSchemaMerge`, `ListTypesByAssociation`
+- **Data source introspection**: `StartDataSourceIntrospection`, `GetDataSourceIntrospection`
## Configuration
@@ -186,4 +274,22 @@ aws appsync create-api-key \
# List all APIs
aws appsync list-graphql-apis \
--endpoint-url $AWS_ENDPOINT_URL
+
+# Register a custom domain
+aws appsync create-domain-name \
+ --domain-name api.example.com \
+ --certificate-arn arn:aws:acm:us-east-1:000000000000:certificate/123 \
+ --endpoint-url $AWS_ENDPOINT_URL
+
+# Associate domain with API
+aws appsync associate-api \
+ --domain-name api.example.com \
+ --api-id API_ID \
+ --endpoint-url $AWS_ENDPOINT_URL
+
+# Create a channel namespace
+aws appsync create-channel-namespace \
+ --api-id API_ID \
+ --name my-channels \
+ --endpoint-url $AWS_ENDPOINT_URL
```
diff --git a/pom.xml b/pom.xml
index c80d88edc1..a7f14dc83e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -162,6 +162,13 @@
2.4.1
+
+
+ com.graphql-java
+ graphql-java
+ 22.0
+
+
com.networknt
diff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncController.java b/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncController.java
index 8904c8fce2..4db4f445ce 100644
--- a/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncController.java
+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncController.java
@@ -62,8 +62,8 @@ public class AppSyncController {
@POST
@Path("/v1/apis/{apiId}")
public Response updateGraphqlApi(@Context HttpHeaders headers,
- @PathParam("apiId") String apiId,
- String body) throws IOException {
+ @PathParam("apiId") String apiId,
+ String body) throws IOException {
String region = regionResolver.resolveRegion(headers);
@SuppressWarnings("unchecked")
Map request = objectMapper.readValue(body, Map.class);
@@ -128,7 +128,9 @@ public class AppSyncController {
public Response getIntrospectionSchema(@PathParam("apiId") String apiId) {
String schema = service.getIntrospectionSchema(apiId);
ObjectNode root = objectMapper.createObjectNode();
- root.put("schema", schema);
+ ObjectNode schemaNode = objectMapper.createObjectNode();
+ schemaNode.put("definition", schema);
+ root.set("schema", schemaNode);
return Response.ok(root).build();
}
@@ -136,10 +138,13 @@ public class AppSyncController {
@POST
@Path("/v1/apis/{apiId}/datasources")
- public Response createDataSource(@PathParam("apiId") String apiId, String body) throws IOException {
+ public Response createDataSource(@Context HttpHeaders headers,
+ @PathParam("apiId") String apiId,
+ String body) throws IOException {
+ String region = regionResolver.resolveRegion(headers);
@SuppressWarnings("unchecked")
Map request = objectMapper.readValue(body, Map.class);
- DataSource ds = service.createDataSource(apiId, request);
+ DataSource ds = service.createDataSource(apiId, request, region);
ObjectNode root = objectMapper.createObjectNode();
root.set("dataSource", objectMapper.valueToTree(ds));
return Response.status(200).entity(root).build();
@@ -157,8 +162,8 @@ public class AppSyncController {
@POST
@Path("/v1/apis/{apiId}/datasources/{name}")
public Response updateDataSource(@PathParam("apiId") String apiId,
- @PathParam("name") String name,
- String body) throws IOException {
+ @PathParam("name") String name,
+ String body) throws IOException {
@SuppressWarnings("unchecked")
Map request = objectMapper.readValue(body, Map.class);
DataSource ds = service.updateDataSource(apiId, name, request);
@@ -170,7 +175,7 @@ public class AppSyncController {
@DELETE
@Path("/v1/apis/{apiId}/datasources/{name}")
public Response deleteDataSource(@PathParam("apiId") String apiId,
- @PathParam("name") String name) {
+ @PathParam("name") String name) {
service.deleteDataSource(apiId, name);
return Response.noContent().build();
}
@@ -196,13 +201,15 @@ public class AppSyncController {
@POST
@Path("/v1/apis/{apiId}/types/{typeName}/resolvers")
- public Response createResolver(@PathParam("apiId") String apiId,
- @PathParam("typeName") String typeName,
- String body) throws IOException {
+ public Response createResolver(@Context HttpHeaders headers,
+ @PathParam("apiId") String apiId,
+ @PathParam("typeName") String typeName,
+ String body) throws IOException {
+ String region = regionResolver.resolveRegion(headers);
@SuppressWarnings("unchecked")
Map request = objectMapper.readValue(body, Map.class);
request.put("typeName", typeName);
- Resolver resolver = service.createResolver(apiId, request);
+ Resolver resolver = service.createResolver(apiId, request, region);
ObjectNode root = objectMapper.createObjectNode();
root.set("resolver", objectMapper.valueToTree(resolver));
return Response.status(200).entity(root).build();
@@ -257,9 +264,9 @@ public class AppSyncController {
@POST
@Path("/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}")
public Response updateResolver(@PathParam("apiId") String apiId,
- @PathParam("typeName") String typeName,
- @PathParam("fieldName") String fieldName,
- String body) throws IOException {
+ @PathParam("typeName") String typeName,
+ @PathParam("fieldName") String fieldName,
+ String body) throws IOException {
@SuppressWarnings("unchecked")
Map request = objectMapper.readValue(body, Map.class);
Resolver resolver = service.updateResolver(apiId, typeName, fieldName, request);
@@ -271,8 +278,8 @@ public class AppSyncController {
@DELETE
@Path("/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}")
public Response deleteResolver(@PathParam("apiId") String apiId,
- @PathParam("typeName") String typeName,
- @PathParam("fieldName") String fieldName) {
+ @PathParam("typeName") String typeName,
+ @PathParam("fieldName") String fieldName) {
service.deleteResolver(apiId, typeName, fieldName);
return Response.noContent().build();
}
@@ -537,4 +544,237 @@ public class AppSyncController {
return Response.ok(root).build();
}
+ // ──────────────────────────── Domain Names ────────────────────────────
+
+ @POST
+ @Path("/v1/domainnames")
+ public Response createDomainName(String body) throws IOException {
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ DomainName dn = service.createDomainName(request);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("domainNameConfig", objectMapper.valueToTree(dn));
+ return Response.status(200).entity(root).build();
+ }
+
+ @GET
+ @Path("/v1/domainnames/{domainName}")
+ public Response getDomainName(@PathParam("domainName") String domainName) {
+ DomainName dn = service.getDomainName(domainName);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("domainNameConfig", objectMapper.valueToTree(dn));
+ return Response.ok(root).build();
+ }
+
+ @GET
+ @Path("/v1/domainnames")
+ public Response listDomainNames(@QueryParam("maxResults") Integer maxResults,
+ @QueryParam("nextToken") String nextToken) {
+ var page = service.listDomainNames(maxResults, nextToken);
+ ObjectNode root = objectMapper.createObjectNode();
+ ArrayNode items = root.putArray("domainNames");
+ page.items().forEach(items::addPOJO);
+ if (page.nextToken() != null) {
+ root.put("nextToken", page.nextToken());
+ } else {
+ root.putNull("nextToken");
+ }
+ return Response.ok(root).build();
+ }
+
+ @POST
+ @Path("/v1/domainnames/{domainName}")
+ public Response updateDomainName(@PathParam("domainName") String domainName,
+ String body) throws IOException {
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ DomainName dn = service.updateDomainName(domainName, request);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("domainNameConfig", objectMapper.valueToTree(dn));
+ return Response.ok(root).build();
+ }
+
+ @DELETE
+ @Path("/v1/domainnames/{domainName}")
+ public Response deleteDomainName(@PathParam("domainName") String domainName) {
+ service.deleteDomainName(domainName);
+ return Response.noContent().build();
+ }
+
+ @POST
+ @Path("/v1/domainnames/{domainName}/apiassociation")
+ public Response associateApi(@PathParam("domainName") String domainName, String body) throws IOException {
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ String apiId = (String) request.get("apiId");
+ var assoc = service.associateApi(domainName, apiId);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("apiAssociation", objectMapper.valueToTree(assoc));
+ return Response.status(200).entity(root).build();
+ }
+
+ @GET
+ @Path("/v1/domainnames/{domainName}/apiassociation")
+ public Response getApiAssociation(@PathParam("domainName") String domainName) {
+ var assoc = service.getApiAssociation(domainName);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("apiAssociation", objectMapper.valueToTree(assoc));
+ return Response.ok(root).build();
+ }
+
+ @DELETE
+ @Path("/v1/domainnames/{domainName}/apiassociation")
+ public Response disassociateApi(@PathParam("domainName") String domainName) {
+ service.disassociateApi(domainName);
+ return Response.noContent().build();
+ }
+
+ // ──────────────────────────── Channel Namespaces ────────────────────────────
+
+ @POST
+ @Path("/v2/apis/{apiId}/channelNamespaces")
+ public Response createChannelNamespace(@PathParam("apiId") String apiId, String body) throws IOException {
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ ChannelNamespace ns = service.createChannelNamespace(apiId, request);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("channelNamespace", objectMapper.valueToTree(ns));
+ return Response.status(200).entity(root).build();
+ }
+
+ @GET
+ @Path("/v2/apis/{apiId}/channelNamespaces/{name}")
+ public Response getChannelNamespace(@PathParam("apiId") String apiId, @PathParam("name") String name) {
+ ChannelNamespace ns = service.getChannelNamespace(apiId, name);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("channelNamespace", objectMapper.valueToTree(ns));
+ return Response.ok(root).build();
+ }
+
+ @POST
+ @Path("/v2/apis/{apiId}/channelNamespaces/{name}")
+ public Response updateChannelNamespace(@PathParam("apiId") String apiId,
+ @PathParam("name") String name,
+ String body) throws IOException {
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ ChannelNamespace ns = service.updateChannelNamespace(apiId, name, request);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("channelNamespace", objectMapper.valueToTree(ns));
+ return Response.ok(root).build();
+ }
+
+ @DELETE
+ @Path("/v2/apis/{apiId}/channelNamespaces/{name}")
+ public Response deleteChannelNamespace(@PathParam("apiId") String apiId, @PathParam("name") String name) {
+ service.deleteChannelNamespace(apiId, name);
+ return Response.noContent().build();
+ }
+
+ @GET
+ @Path("/v2/apis/{apiId}/channelNamespaces")
+ public Response listChannelNamespaces(@PathParam("apiId") String apiId,
+ @QueryParam("maxResults") Integer maxResults,
+ @QueryParam("nextToken") String nextToken) {
+ var page = service.listChannelNamespaces(apiId, maxResults, nextToken);
+ ObjectNode root = objectMapper.createObjectNode();
+ ArrayNode items = root.putArray("channelNamespaces");
+ page.items().forEach(items::addPOJO);
+ if (page.nextToken() != null) {
+ root.put("nextToken", page.nextToken());
+ } else {
+ root.putNull("nextToken");
+ }
+ return Response.ok(root).build();
+ }
+
+ // ──────────────────────────── Merged API Associations ─────────────────
+
+ @POST
+ @Path("/v1/sourceApis/{sourceApiIdentifier}/mergedApiAssociations")
+ public Response associateMergedGraphqlApi(@Context HttpHeaders headers,
+ @PathParam("sourceApiIdentifier") String sourceApiIdentifier,
+ String body) throws IOException {
+ String region = regionResolver.resolveRegion(headers);
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ var assoc = service.createMergedApiAssociation(sourceApiIdentifier, request, region);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("sourceApiAssociation", objectMapper.valueToTree(assoc));
+ return Response.status(200).entity(root).build();
+ }
+
+ @POST
+ @Path("/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations")
+ public Response associateSourceGraphqlApi(@Context HttpHeaders headers,
+ @PathParam("mergedApiIdentifier") String mergedApiIdentifier,
+ String body) throws IOException {
+ String region = regionResolver.resolveRegion(headers);
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ var assoc = service.createSourceApiAssociation(mergedApiIdentifier, request, region);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("sourceApiAssociation", objectMapper.valueToTree(assoc));
+ return Response.status(200).entity(root).build();
+ }
+
+ @GET
+ @Path("/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}")
+ public Response getSourceApiAssociation(@PathParam("mergedApiIdentifier") String mergedApiIdentifier,
+ @PathParam("associationId") String associationId) {
+ var assoc = service.getSourceApiAssociation(mergedApiIdentifier, associationId);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("sourceApiAssociation", objectMapper.valueToTree(assoc));
+ return Response.ok(root).build();
+ }
+
+ @POST
+ @Path("/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}")
+ public Response updateSourceApiAssociation(@PathParam("mergedApiIdentifier") String mergedApiIdentifier,
+ @PathParam("associationId") String associationId,
+ String body) throws IOException {
+ @SuppressWarnings("unchecked")
+ Map request = objectMapper.readValue(body, Map.class);
+ var assoc = service.updateSourceApiAssociation(mergedApiIdentifier, associationId, request);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.set("sourceApiAssociation", objectMapper.valueToTree(assoc));
+ return Response.ok(root).build();
+ }
+
+ @GET
+ @Path("/v1/apis/{apiId}/sourceApiAssociations")
+ public Response listSourceApiAssociations(@PathParam("apiId") String apiId,
+ @QueryParam("maxResults") Integer maxResults,
+ @QueryParam("nextToken") String nextToken) {
+ var page = service.listSourceApiAssociations(apiId, maxResults, nextToken);
+ ObjectNode root = objectMapper.createObjectNode();
+ ArrayNode items = root.putArray("sourceApiAssociationSummaries");
+ page.items().forEach(items::addPOJO);
+ if (page.nextToken() != null) {
+ root.put("nextToken", page.nextToken());
+ } else {
+ root.putNull("nextToken");
+ }
+ return Response.ok(root).build();
+ }
+
+ @DELETE
+ @Path("/v1/mergedApis/{mergedApiIdentifier}/sourceApiAssociations/{associationId}")
+ public Response disassociateSourceGraphqlApi(@PathParam("mergedApiIdentifier") String mergedApiIdentifier,
+ @PathParam("associationId") String associationId) {
+ service.deleteSourceApiAssociation(mergedApiIdentifier, associationId);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.put("sourceApiAssociationStatus", "DELETION_SCHEDULED");
+ return Response.ok(root).build();
+ }
+
+ @DELETE
+ @Path("/v1/sourceApis/{sourceApiIdentifier}/mergedApiAssociations/{associationId}")
+ public Response disassociateMergedGraphqlApi(@PathParam("sourceApiIdentifier") String sourceApiIdentifier,
+ @PathParam("associationId") String associationId) {
+ var assoc = service.deleteMergedApiAssociation(sourceApiIdentifier, associationId);
+ ObjectNode root = objectMapper.createObjectNode();
+ root.put("sourceApiAssociationStatus", assoc.getSourceApiAssociationStatus());
+ return Response.ok(root).build();
+ }
}
diff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncService.java b/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncService.java
index 7f27bf3d89..f43b555cf3 100644
--- a/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncService.java
+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/AppSyncService.java
@@ -1,18 +1,19 @@
package io.github.hectorvent.floci.services.appsync;
import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.hectorvent.floci.config.EmulatorConfig;
import io.github.hectorvent.floci.core.common.AwsException;
import io.github.hectorvent.floci.core.common.RegionResolver;
import io.github.hectorvent.floci.core.storage.StorageBackend;
import io.github.hectorvent.floci.core.storage.StorageFactory;
+import io.github.hectorvent.floci.services.appsync.graphql.SchemaRegistry;
import io.github.hectorvent.floci.services.appsync.model.*;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.Base64;
@ApplicationScoped
@@ -20,17 +21,24 @@ public class AppSyncService {
private static final Logger LOG = Logger.getLogger(AppSyncService.class);
private final StorageBackend apiStore;
- private final StorageBackend schemaStore; // apiId -> schema SDL
+ private final StorageBackend schemaStore;
private final StorageBackend schemaStatusStore;
private final StorageBackend dataSourceStore;
private final StorageBackend resolverStore;
private final StorageBackend functionStore;
private final StorageBackend apiKeyStore;
private final StorageBackend typeStore;
+ private final StorageBackend domainStore;
+ private final StorageBackend associationStore;
+ private final StorageBackend channelNamespaceStore;
+ private final StorageBackend mergedApiAssociationStore;
private final RegionResolver regionResolver;
+ private final SchemaRegistry schemaRegistry;
+ private final ObjectMapper objectMapper;
@Inject
- public AppSyncService(StorageFactory storageFactory, EmulatorConfig config, RegionResolver regionResolver) {
+ public AppSyncService(StorageFactory storageFactory, EmulatorConfig config, RegionResolver regionResolver,
+ SchemaRegistry schemaRegistry, ObjectMapper objectMapper) {
this.apiStore = storageFactory.create("appsync", "appsync-apis.json", new TypeReference<>() {});
this.schemaStore = storageFactory.create("appsync", "appsync-schemas.json", new TypeReference<>() {});
this.schemaStatusStore = storageFactory.create("appsync", "appsync-schema-status.json", new TypeReference<>() {});
@@ -39,7 +47,13 @@ public class AppSyncService {
this.functionStore = storageFactory.create("appsync", "appsync-functions.json", new TypeReference<>() {});
this.apiKeyStore = storageFactory.create("appsync", "appsync-apikeys.json", new TypeReference<>() {});
this.typeStore = storageFactory.create("appsync", "appsync-types.json", new TypeReference<>() {});
+ this.domainStore = storageFactory.create("appsync", "appsync-domainnames.json", new TypeReference<>() {});
+ this.associationStore = storageFactory.create("appsync", "appsync-associations.json", new TypeReference<>() {});
+ this.channelNamespaceStore = storageFactory.create("appsync", "appsync-channelnamespaces.json", new TypeReference<>() {});
+ this.mergedApiAssociationStore = storageFactory.create("appsync", "appsync-merged-api-associations.json", new TypeReference<>() {});
this.regionResolver = regionResolver;
+ this.schemaRegistry = schemaRegistry;
+ this.objectMapper = objectMapper;
}
// ──────────────────────────── GraphQL API ────────────────────────────
@@ -49,11 +63,15 @@ public class AppSyncService {
if (name == null || name.isBlank()) {
throw new AwsException("BadRequestException", "A GraphQL API name is required", 400);
}
+ String authType = (String) request.get("authenticationType");
+ if (authType == null || authType.isBlank()) {
+ throw new AwsException("BadRequestException", "The authenticationType is required", 400);
+ }
String apiId = generateApiId();
GraphqlApi api = new GraphqlApi();
api.setApiId(apiId);
api.setName(name);
- api.setAuthenticationType(parseEnum(AuthenticationType.class, request.get("authenticationType")));
+ api.setAuthenticationType(parseEnum(AuthenticationType.class, authType));
Object xrayValue = request.get("xrayEnabled");
if (xrayValue instanceof Boolean b) {
api.setXrayEnabled(b);
@@ -62,18 +80,27 @@ public class AppSyncService {
} else {
api.setXrayEnabled(false);
}
- api.setLogConfig((Map) request.get("logConfig"));
+ api.setLogConfig(castMap(request.get("logConfig")));
+
+ api.setApiType(coerceString(request.get("apiType"), "GRAPHQL"));
+ api.setOwner(coerceString(request.get("owner")));
+ api.setOwnerContact(coerceString(request.get("ownerContact")));
+ api.setVisibility(coerceString(request.get("visibility"), "GLOBAL"));
+ api.setIntrospectionConfig(coerceString(request.get("introspectionConfig")));
+ api.setQueryDepthLimit(castInt(request.get("queryDepthLimit")));
+ api.setResolverCountLimit(castInt(request.get("resolverCountLimit")));
+ api.setEnhancedMetricsConfig(castMap(request.get("enhancedMetricsConfig")));
+ api.setLambdaAuthorizerConfig(castMap(request.get("lambdaAuthorizerConfig")));
+ api.setOpenIDConnectConfig(castMap(request.get("openIDConnectConfig")));
+ api.setUserPoolConfig(castMap(request.get("userPoolConfig")));
+ api.setDns(castStringMap(request.get("dns")));
+ api.setWafWebAclArn(coerceString(request.get("wafWebAclArn")));
+ api.setMergedApiExecutionRoleArn(coerceString(request.get("mergedApiExecutionRoleArn")));
Object additionalObj = request.get("additionalAuthenticationProviders");
if (additionalObj instanceof List> additionalList) {
- List