How to save a singleton using SwiftData?

I am persisting a tree data structure Node using SwiftData with CloudKit enabled. I understand how to manage my NonSingleton models in SwiftUI. However, when a user first launches my app a Node model instance needs to be created that is separate from any NonSingleton model. So I think a Singleton class is appropriate but I don't know how to persist it?

@Model
final class Node {
    var parent: Node?

    @Relationship(deleteRule: .cascade, inverse: \Node.parent) 
    var children = [Node]()
    // ...
}

@Model
final class NonSingleton {
    @Relationship(deleteRule: .cascade) var node: Node
    // ...
 }

@Model // ?
final class Singleton {
    static var node = Node()
    
    private init() {}
}

It seems that SwiftData ignores static properties. When I add one to the SwiftData template Item model, the shared property isn't persisted.

@Model
final class Item {
    var timestamp: Date
    static var shared: Int = 0
    
    init(timestamp: Date) {
        self.timestamp = timestamp
        Item.shared += 1
    }
}

In my original scenario it seems my options are:

  1. Save an identifier to a Node instance in NSUbiquitousKeyValueStore and on relaunches of the app to somehow use that to fetch the Node from the container and assign it to the Singleton node property.
  2. Make the Singleton class a regular SwiftData model without static properties but to make sure only one object is ever saved.

Does anyone with experience using NSUbiquitousKeyValueStore be able comment on whether option one is feasible?

How to save a singleton using SwiftData?
 
 
Q