Problem fixing error message related to optionals

I've got some code that's generated (by SwiftGraphQL). I'd like to use it, but I'm bumping into an error message. I've tried to minimize the code; the following can be pasted into a playground:

public enum Objects {
    public struct Query {}
    public struct Starship {}
}

public final class Fields<TypeLock> {
    public private(set) var data: Codable

    public init(data: Codable) {
        self.data = data
    }
}

public struct Selection<T, TypeLock> {
    private var decoder: (Fields<TypeLock>) throws -> T

    public init(decoder: @escaping (Fields<TypeLock>) throws -> T) {
        self.decoder = decoder
    }
}

extension Selection where T == Never, TypeLock == Never {
    public typealias Root<T> = Selection<T, Objects.Query>
}

extension Selection where T == Never, TypeLock == Never {
    public typealias Starship<T> = Selection<T, Objects.Starship>
}

extension Fields where TypeLock == Objects.Starship {
    public func name() throws -> String? {
        return "X-Wing"
    }
}

extension Fields where TypeLock == Objects.Query {
    public func starship<T>(
        id: String,
        selection: Selection<T, Objects.Starship?>
    ) throws -> T {
        return Objects.Starship() as! T
    }
}

And this is my own code:

struct MyStarshipModel {
    var name: String

    init?(name: String?) {
        guard let name else {
            return nil
        }
        self.name = name
    }
}

let starshipSelection = Selection.Starship(decoder: {
    MyStarshipModel(name: try $0.name())
})

let query = Selection.Root {
    $0.starship(id: "abcxyz", selection: starshipSelection)
}

The last stanza gives me the following error:

Cannot convert value of type 'Selection<MyStarshipModel?, Objects.Starship>' to expected argument type 'Selection<MyStarshipModel?, Objects.Starship?>'

I can't for the life of me, cast the starshipSelection such that it compiles. The difference is just one optional so it shouldn't be so hard, I'm hoping I'm just tired and overlook the obvious. What's the solution here?

If you change "Objects.Starship?" to "Objects.Starship" and then add the missing try before "$0.starship..." - it compiles. No idea how to fix it without modifying the autogenerated source.

I've tried the following:

let starshipSelection: Selection<MyStarshipModel?, Objects.Starship?> =
    Selection.Starship(decoder: {
        MyStarshipModel(name: try $0.name())
    })

The compiler then says: Cannot assign value of type 'Selection<MyStarshipModel?, Objects.Starship>' to type 'Selection<MyStarshipModel?, Objects.Starship?>'

Am I not overlooking something here? It should be possible to make the Objcts.Starship on the right-hand-side of the assignment into an optional?