Skip to content

Commit

Permalink
fix: add missing closing parens on swift hasMany
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilch committed May 6, 2024
1 parent cc88595 commit e71dc3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ extension Primary {
.field(primary.instanceId, is: .required, ofType: .string),
.field(primary.recordId, is: .required, ofType: .string),
.field(primary.content, is: .optional, ofType: .string),
.hasMany(primary.related, is: .optional, ofType: Related.self, associatedFields: [Related.keys.primary],
.hasMany(primary.related, is: .optional, ofType: Related.self, associatedFields: [Related.keys.primary]),
.field(primary.createdAt, is: .optional, isReadOnly: true, ofType: .dateTime),
.field(primary.updatedAt, is: .optional, isReadOnly: true, ofType: .dateTime)
)
Expand Down Expand Up @@ -2150,7 +2150,7 @@ extension SqlPrimary {
model.fields(
.field(sqlPrimary.id, is: .required, ofType: .int),
.field(sqlPrimary.content, is: .optional, ofType: .string),
.hasMany(sqlPrimary.related, is: .optional, ofType: SqlRelated.self, associatedFields: [SqlRelated.keys.primary],
.hasMany(sqlPrimary.related, is: .optional, ofType: SqlRelated.self, associatedFields: [SqlRelated.keys.primary]),
.field(sqlPrimary.createdAt, is: .optional, isReadOnly: true, ofType: .dateTime),
.field(sqlPrimary.updatedAt, is: .optional, isReadOnly: true, ofType: .dateTime)
)
Expand Down Expand Up @@ -2398,7 +2398,7 @@ extension Primary {

model.fields(
.field(primary.id, is: .required, ofType: .string),
.hasMany(primary.relatedMany, is: .optional, ofType: RelatedMany.self, associatedFields: [RelatedMany.keys.primary],
.hasMany(primary.relatedMany, is: .optional, ofType: RelatedMany.self, associatedFields: [RelatedMany.keys.primary]),
.hasOne(primary.relatedOne, is: .optional, ofType: RelatedOne.self, associatedFields: [RelatedOne.keys.primary]),
.field(primary.createdAt, is: .optional, isReadOnly: true, ofType: .dateTime),
.field(primary.updatedAt, is: .optional, isReadOnly: true, ofType: .dateTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,11 +622,11 @@ export class AppSyncSwiftVisitor<
if (connectionInfo.kind === CodeGenConnectionType.HAS_MANY) {
let association = `associatedWith: ${this.getModelName(
connectionInfo.connectedModel,
)}.keys.${this.getFieldName(connectionInfo.associatedWith)})`;
)}.keys.${this.getFieldName(connectionInfo.associatedWith)}`;
if (connectionInfo.associatedWithNativeReferences) {
association = `associatedFields: [${this.getCodingKey(connectionInfo.connectedModel, connectionInfo.associatedWithNativeReferences)}]`
}
return `.hasMany(${name}, is: ${isRequired}, ofType: ${typeName}, ${association}`;
return `.hasMany(${name}, is: ${isRequired}, ofType: ${typeName}, ${association})`;
}
if (connectionInfo.kind === CodeGenConnectionType.HAS_ONE) {
let association = `associatedWith: ${this.getModelName(
Expand Down

0 comments on commit e71dc3c

Please sign in to comment.