Skip to content

Commit ca26897

Browse files
authored
Merge pull request #785 from aws-amplify/main
Release Codegen Plugin
2 parents ca98131 + dbfc8c1 commit ca26897

14 files changed

+617
-639
lines changed

dependency_licenses.txt

Lines changed: 35 additions & 214 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
"js-yaml": "^4.0.0",
114114
"lnk": "1.1.0",
115115
"prettier": "^1.19.1",
116-
"prettier-eslint": "^9.0.1",
117116
"pretty-quick": "^3.1.0",
118117
"rimraf": "^3.0.0",
119118
"ts-jest": "^27.0.0",

packages/appsync-modelgen-plugin/API.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ export interface AppSyncModelPluginConfig extends RawDocumentsConfig {
2525
directives?: string;
2626
}
2727

28+
// @public (undocumented)
29+
export type Argument = {
30+
name: string;
31+
type: FieldType;
32+
isArray: boolean;
33+
isRequired: boolean;
34+
isArrayNullable?: boolean;
35+
};
36+
37+
// @public (undocumented)
38+
export type Arguments = Record<string, Argument>;
39+
2840
// @public (undocumented)
2941
export type AssociationBaseType = {
3042
connectionType: CodeGenConnectionType;
@@ -72,6 +84,7 @@ export type Field = {
7284
isArrayNullable?: boolean;
7385
attributes?: FieldAttribute[];
7486
association?: AssociationType;
87+
arguments?: Arguments;
7588
};
7689

7790
// @public (undocumented)
@@ -103,6 +116,9 @@ export type ModelIntrospectionSchema = {
103116
models: SchemaModels;
104117
nonModels: SchemaNonModels;
105118
enums: SchemaEnums;
119+
queries?: SchemaQueries;
120+
mutations?: SchemaMutations;
121+
subscriptions?: SchemaSubscriptions;
106122
};
107123

108124
// Warning: (ae-forgotten-export) The symbol "RawAppSyncModelConfig" needs to be exported by the entry point index.d.ts
@@ -142,6 +158,12 @@ export type SchemaModel = {
142158
// @public (undocumented)
143159
export type SchemaModels = Record<string, SchemaModel>;
144160

161+
// @public (undocumented)
162+
export type SchemaMutation = SchemaQuery;
163+
164+
// @public (undocumented)
165+
export type SchemaMutations = Record<string, SchemaMutation>;
166+
145167
// @public (undocumented)
146168
export type SchemaNonModel = {
147169
name: string;
@@ -151,6 +173,18 @@ export type SchemaNonModel = {
151173
// @public (undocumented)
152174
export type SchemaNonModels = Record<string, SchemaNonModel>;
153175

176+
// @public (undocumented)
177+
export type SchemaQueries = Record<string, SchemaQuery>;
178+
179+
// @public (undocumented)
180+
export type SchemaQuery = Pick<Field, 'name' | 'type' | 'isArray' | 'isRequired' | 'isArrayNullable' | 'arguments'>;
181+
182+
// @public (undocumented)
183+
export type SchemaSubscription = SchemaQuery;
184+
185+
// @public (undocumented)
186+
export type SchemaSubscriptions = Record<string, SchemaSubscription>;
187+
154188
// @public (undocumented)
155189
export type Target = 'java' | 'swift' | 'javascript' | 'typescript' | 'dart' | 'introspection';
156190

packages/appsync-modelgen-plugin/schemas/introspection/1/ModelIntrospectionSchema.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
},
1515
"enums": {
1616
"$ref": "#/definitions/SchemaEnums"
17+
},
18+
"queries": {
19+
"$ref": "#/definitions/SchemaQueries"
20+
},
21+
"mutations": {
22+
"$ref": "#/definitions/SchemaMutations"
23+
},
24+
"subscriptions": {
25+
"$ref": "#/definitions/SchemaSubscriptions"
1726
}
1827
},
1928
"required": [
@@ -122,6 +131,9 @@
122131
},
123132
"association": {
124133
"$ref": "#/definitions/AssociationType"
134+
},
135+
"arguments": {
136+
"$ref": "#/definitions/Arguments"
125137
}
126138
},
127139
"required": [
@@ -317,6 +329,42 @@
317329
"targetNames"
318330
]
319331
},
332+
"Arguments": {
333+
"$ref": "#/definitions/Record%3Cstring%2CArgument%3E"
334+
},
335+
"Record<string,Argument>": {
336+
"type": "object",
337+
"additionalProperties": {
338+
"$ref": "#/definitions/Argument"
339+
}
340+
},
341+
"Argument": {
342+
"type": "object",
343+
"properties": {
344+
"name": {
345+
"type": "string"
346+
},
347+
"type": {
348+
"$ref": "#/definitions/FieldType"
349+
},
350+
"isArray": {
351+
"type": "boolean"
352+
},
353+
"isRequired": {
354+
"type": "boolean"
355+
},
356+
"isArrayNullable": {
357+
"type": "boolean"
358+
}
359+
},
360+
"required": [
361+
"name",
362+
"type",
363+
"isArray",
364+
"isRequired"
365+
],
366+
"additionalProperties": false
367+
},
320368
"PrimaryKeyInfo": {
321369
"type": "object",
322370
"properties": {
@@ -392,6 +440,72 @@
392440
"values"
393441
],
394442
"additionalProperties": false
443+
},
444+
"SchemaQueries": {
445+
"$ref": "#/definitions/Record%3Cstring%2CSchemaQuery%3E"
446+
},
447+
"Record<string,SchemaQuery>": {
448+
"type": "object",
449+
"additionalProperties": {
450+
"$ref": "#/definitions/SchemaQuery"
451+
}
452+
},
453+
"SchemaQuery": {
454+
"$ref": "#/definitions/Pick%3CField%2C(%22name%22%7C%22type%22%7C%22isArray%22%7C%22isRequired%22%7C%22isArrayNullable%22%7C%22arguments%22)%3E"
455+
},
456+
"Pick<Field,(\"name\"|\"type\"|\"isArray\"|\"isRequired\"|\"isArrayNullable\"|\"arguments\")>": {
457+
"type": "object",
458+
"properties": {
459+
"name": {
460+
"type": "string"
461+
},
462+
"type": {
463+
"$ref": "#/definitions/FieldType"
464+
},
465+
"isArray": {
466+
"type": "boolean"
467+
},
468+
"isRequired": {
469+
"type": "boolean"
470+
},
471+
"isArrayNullable": {
472+
"type": "boolean"
473+
},
474+
"arguments": {
475+
"$ref": "#/definitions/Arguments"
476+
}
477+
},
478+
"required": [
479+
"name",
480+
"type",
481+
"isArray",
482+
"isRequired"
483+
],
484+
"additionalProperties": false
485+
},
486+
"SchemaMutations": {
487+
"$ref": "#/definitions/Record%3Cstring%2CSchemaMutation%3E"
488+
},
489+
"Record<string,SchemaMutation>": {
490+
"type": "object",
491+
"additionalProperties": {
492+
"$ref": "#/definitions/SchemaMutation"
493+
}
494+
},
495+
"SchemaMutation": {
496+
"$ref": "#/definitions/SchemaQuery"
497+
},
498+
"SchemaSubscriptions": {
499+
"$ref": "#/definitions/Record%3Cstring%2CSchemaSubscription%3E"
500+
},
501+
"Record<string,SchemaSubscription>": {
502+
"type": "object",
503+
"additionalProperties": {
504+
"$ref": "#/definitions/SchemaSubscription"
505+
}
506+
},
507+
"SchemaSubscription": {
508+
"$ref": "#/definitions/SchemaQuery"
395509
}
396510
}
397511
}

packages/appsync-modelgen-plugin/src/__tests__/utils/process-index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe('processIndex', () => {
246246
arguments: {
247247
name: 'testModelsByConnectionFieldAndSortField',
248248
fields: ['connectionField', 'sortField'],
249-
queryField: undefined,
249+
queryField: undefined,
250250
},
251251
},
252252
{

0 commit comments

Comments
 (0)