Skip to content

Commit e2e3482

Browse files
authored
chore: Update GraphQL configuration shape to expect AI routes (#13799)
* chore: Update GraphQL configuration shape to expect AI routes * Bump minimum data-schema version * Bump size limit
1 parent a76b594 commit e2e3482

File tree

4 files changed

+76
-16
lines changed

4 files changed

+76
-16
lines changed

packages/api-graphql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"dependencies": {
8787
"@aws-amplify/api-rest": "4.0.47",
8888
"@aws-amplify/core": "6.4.0",
89-
"@aws-amplify/data-schema": "^1.0.0",
89+
"@aws-amplify/data-schema": "^1.5.0",
9090
"@aws-sdk/types": "3.387.0",
9191
"graphql": "15.8.0",
9292
"rxjs": "^7.8.1",

packages/aws-amplify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
"name": "[API] generateClient (AppSync)",
336336
"path": "./dist/esm/api/index.mjs",
337337
"import": "{ generateClient }",
338-
"limit": "41.5 kB"
338+
"limit": "43.1 kB"
339339
},
340340
{
341341
"name": "[API] REST API handlers",

packages/core/src/singleton/API/types.ts

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export interface ModelIntrospectionSchema {
111111
queries?: CustomOperations;
112112
mutations?: CustomOperations;
113113
subscriptions?: CustomOperations;
114+
conversations?: SchemaConversationRoutes;
115+
generations?: SchemaGenerationRoutes;
114116
}
115117

116118
/**
@@ -120,6 +122,27 @@ export type SchemaModels = Record<string, SchemaModel>;
120122
export type SchemaNonModels = Record<string, SchemaNonModel>;
121123
export type SchemaEnums = Record<string, SchemaEnum>;
122124
export type CustomOperations = Record<string, CustomOperation>;
125+
type SchemaConversationRoutes = Record<string, SchemaConversationRoute>;
126+
type SchemaGenerationRoutes = Record<string, CustomOperation>;
127+
128+
interface SchemaConversationRoute {
129+
name: string;
130+
models: SchemaModels;
131+
nonModels: SchemaNonModels;
132+
enums: SchemaEnums;
133+
conversation: SchemaConversation;
134+
message: SchemaConversationMessage;
135+
}
136+
137+
interface SchemaConversation {
138+
modelName: string;
139+
}
140+
141+
interface SchemaConversationMessage {
142+
modelName: string;
143+
subscribe: CustomOperation;
144+
send: CustomOperation;
145+
}
123146

124147
export interface SchemaModel {
125148
name: string;
@@ -164,7 +187,7 @@ export type CustomOperationArguments = Record<string, CustomOperationArgument>;
164187

165188
export interface CustomOperationArgument {
166189
name: string;
167-
type: FieldType;
190+
type: InputFieldType;
168191
isArray: boolean;
169192
isRequired: boolean;
170193
isArrayNullable?: boolean;
@@ -192,7 +215,15 @@ export interface NonModelFieldType {
192215
nonModel: string;
193216
}
194217

195-
export type FieldType =
218+
interface EnumType {
219+
enum: string;
220+
}
221+
222+
interface InputType {
223+
input: string;
224+
}
225+
226+
type ScalarType =
196227
| 'ID'
197228
| 'String'
198229
| 'Int'
@@ -206,10 +237,12 @@ export type FieldType =
206237
| 'AWSIPAddress'
207238
| 'Boolean'
208239
| 'AWSJSON'
209-
| 'AWSPhone'
210-
| { enum: string }
211-
| ModelFieldType
212-
| NonModelFieldType;
240+
| 'AWSPhone';
241+
242+
type FieldType = ScalarType | EnumType | ModelFieldType | NonModelFieldType;
243+
244+
type InputFieldType = ScalarType | EnumType | InputType;
245+
213246
export type FieldAttribute = ModelAttribute;
214247

215248
/**

yarn.lock

Lines changed: 35 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)