You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the more general fragment work mentioned in the Generated models section of the RFC. This will probably have a dependency on #3139 being completed first.
Regardless of the fragment/field solution chosen all deferred fragment definitions in generated models __selections will get an additional property to indicate they are deferred. This helps to understand the models when reading them as well as being used by internal code.
// Updated Selection enum
public enum Selection {
// other cases not shown
case fragment(any Fragment.Type, deferred: Bool)
case inlineFragment(any InlineFragment.Type, deferred: Bool)
// other properties and types not shown
}
// Sample usage in a generated model
public class ExampleQuery: GraphQLQuery {
// other properties and types not shown
public struct Data: ExampleSchema.SelectionSet {
public static var __selections: [ApolloAPI.Selection] { [
.fragment(EntityFragment.self, deferred: true),
.inlineFragment(AsEntity.self, deferred: true),
] }
}
}
The text was updated successfully, but these errors were encountered:
This is the more general fragment work mentioned in the Generated models section of the RFC. This will probably have a dependency on #3139 being completed first.
The text was updated successfully, but these errors were encountered: