From 756bb79469239b32a2261028ec03654a6aad81d0 Mon Sep 17 00:00:00 2001 From: Aaron S Date: Tue, 29 Oct 2024 13:48:22 -0500 Subject: [PATCH] feat: Add modelIntrospectionSchema to graphql api surface --- .../src/amplify-graphql-api.ts | 8 ++++++++ packages/amplify-graphql-api-construct/src/types.ts | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts b/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts index 2d77a15c9a..f308c63d6f 100644 --- a/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts +++ b/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts @@ -123,6 +123,11 @@ export class AmplifyGraphqlApi extends Construct { */ public readonly apiId: string; + /** + * Model introspection schema + */ + public readonly modelIntrospectionSchema?: string; + /** * DataStore conflict resolution setting */ @@ -158,8 +163,11 @@ export class AmplifyGraphqlApi extends Construct { functionNameMap, outputStorageStrategy, dataStoreConfiguration, + modelIntrospectionSchema, } = props; + this.modelIntrospectionSchema = modelIntrospectionSchema; + if (conflictResolution && dataStoreConfiguration) { throw new Error( 'conflictResolution is deprecated. conflictResolution and dataStoreConfiguration cannot be used together. Please use dataStoreConfiguration.', diff --git a/packages/amplify-graphql-api-construct/src/types.ts b/packages/amplify-graphql-api-construct/src/types.ts index d1085c115b..3bb94f1cda 100644 --- a/packages/amplify-graphql-api-construct/src/types.ts +++ b/packages/amplify-graphql-api-construct/src/types.ts @@ -762,6 +762,11 @@ export interface AmplifyGraphqlApiProps { * For more information, refer to https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/ */ readonly dataStoreConfiguration?: DataStoreConfiguration; + + /** + * The model introspection schema for this graphql schema + */ + readonly modelIntrospectionSchema?: string; } /** @@ -859,6 +864,11 @@ export interface AmplifyGraphqlApiResources { * Nested Stacks generated by the Api Construct. */ readonly nestedStacks: Record; + + /** + * Model introspection schema + */ + readonly modelIntrospectionSchema?: string; } /**