Replies: 1 comment 8 replies
-
You could make them children of Selection, it would not be that much shorter but you can use the dot syntax which autocompletes rather than the Example with typealias on Selection: // Create a selection.
let human = Selection.Human {
Human(
id: try $0.id(),
name: try $0.name(),
homePlanet: try $0.homePlanet()
)
}
// Construct a query.
let query = Selection.Query {
try $0.humans(human.list)
} To make this work we need to generate this: extension Selection where TypeLock == Never, Type == Never {
typealias Human<T> = Selection<T, Objects.Human>
typealias Query<T> = Selection<T, Operations.Query>
} |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be very beneficial if instead of having to write
Selection<TypeLock, Target>
, you could writeSType<Target>
. We can generate bindings for all the internal types since those are of finite set magnitude, and reduce the complexity drastically.To showcase the idea, here's a rewritten example from our docs with the new implementation.
Open questions:
Beta Was this translation helpful? Give feedback.
All reactions