File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
packages/appsync-modelgen-plugin/src
__tests__/visitors/__snapshots__ Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -417,14 +417,8 @@ extension ModelExplicitDefaultPk {
417
417
}
418
418
419
419
extension ModelExplicitDefaultPk: ModelIdentifiable {
420
- public typealias IdentifierFormat = ModelIdentifierFormat .Custom
421
- public typealias IdentifierProtocol = ModelIdentifier < Self , ModelIdentifierFormat .Custom >
422
- }
423
-
424
- extension ModelExplicitDefaultPk.IdentifierProtocol {
425
- public static func identifier (id : String ) - > Self {
426
- .make(fields : [(name : \\" id\\ " , value : id )])
427
- }
420
+ public typealias IdentifierFormat = ModelIdentifierFormat .Default
421
+ public typealias IdentifierProtocol = DefaultModelIdentifier <Self >
428
422
}"
429
423
`;
430
424
Original file line number Diff line number Diff line change @@ -320,7 +320,8 @@ export class AppSyncSwiftVisitor<
320
320
let result : string [ ] = [ ] ;
321
321
const primaryKeyField = model . fields . find ( field => field . primaryKeyInfo ) ! ;
322
322
const { primaryKeyType, sortKeyFields } = primaryKeyField . primaryKeyInfo ! ;
323
- const useDefaultExplicitID = primaryKeyType === CodeGenPrimaryKeyType . ManagedId ;
323
+ const useDefaultExplicitID =
324
+ primaryKeyType === CodeGenPrimaryKeyType . ManagedId || primaryKeyType === CodeGenPrimaryKeyType . OptionallyManagedId ;
324
325
325
326
const identifiableExtension = new SwiftDeclarationBlock ( )
326
327
. asKind ( 'extension' )
You can’t perform that action at this time.
0 commit comments