Skip to content

Commit

Permalink
update inline comment and exclude unions/interfaces in generation routes
Browse files Browse the repository at this point in the history
  • Loading branch information
atierian committed Sep 3, 2024
1 parent 3a359d3 commit 9205ea4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,18 @@ export class AppSyncModelIntrospectionVisitor<
const queries = Object.values(this.queryMap).reduce((acc, queryObj: CodeGenQuery) => {
// Skip the field if the field type is union/interface
// TODO: Remove this skip once these types are supported for stakeholder usages
// Also skip if this query has a generation directive. These are handled separately and keyed under `generations`.
const fieldType = this.getType(queryObj.type) as any;
if (this.isUnionFieldType(fieldType) || this.isInterfaceFieldType(fieldType) || containsGenerationDirective(queryObj)) {
return acc;
}
return { ...acc, [queryObj.name]: this.generateGraphQLOperationMetadata<CodeGenQuery, SchemaQuery>(queryObj) };
}, {})
const generations = Object.values(this.queryMap).reduce((acc, queryObj: CodeGenQuery) => {
if (!containsGenerationDirective(queryObj)) {
// Skip the field if the field type is union/interface
// TODO: Remove this skip once these types are supported for stakeholder usages
const fieldType = this.getType(queryObj.type) as any;
if (this.isUnionFieldType(fieldType) || this.isInterfaceFieldType(fieldType) || !containsGenerationDirective(queryObj)) {
return acc;
}
return { ...acc, [queryObj.name]: this.generateGenerationMetadata(queryObj) };
Expand Down

0 comments on commit 9205ea4

Please sign in to comment.