Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Reduce Generated Schema Types #601

Merged
merged 8 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/AnimalKingdomAPI/AnimalKingdomAPI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
.library(name: "AnimalKingdomAPITestMocks", targets: ["AnimalKingdomAPITestMocks"]),
],
dependencies: [
.package(url: "https://github.com/apollographql/apollo-ios.git", from: "1.0.0"),
.package(url: "https://github.com/apollographql/apollo-ios", exact: "1.16.1"),
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,17 @@
import ApolloAPI

public extension Interfaces {
static let Animal = ApolloAPI.Interface(name: "Animal", keyFields: ["id"])
static let Animal = ApolloAPI.Interface(
name: "Animal",
keyFields: ["id"],
implementingObjects: [
"Human",
"Cat",
"Dog",
"Bird",
"Fish",
"Rat",
"Crocodile"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
import ApolloAPI

public extension Interfaces {
static let HousePet = ApolloAPI.Interface(name: "HousePet", keyFields: ["id"])
static let HousePet = ApolloAPI.Interface(
name: "HousePet",
keyFields: ["id"],
implementingObjects: ["Dog"]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,16 @@
import ApolloAPI

public extension Interfaces {
static let Pet = ApolloAPI.Interface(name: "Pet", keyFields: ["id"])
static let Pet = ApolloAPI.Interface(
name: "Pet",
keyFields: ["id"],
implementingObjects: [
"Cat",
"Dog",
"Bird",
"Fish",
"Rat",
"PetRock"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@
import ApolloAPI

public extension Interfaces {
static let WarmBlooded = ApolloAPI.Interface(name: "WarmBlooded", keyFields: ["id"])
static let WarmBlooded = ApolloAPI.Interface(
name: "WarmBlooded",
keyFields: ["id"],
implementingObjects: [
"Human",
"Cat",
"Dog",
"Bird"
]
)
}
2 changes: 1 addition & 1 deletion Sources/GitHubAPI/GitHubAPI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
.library(name: "GitHubAPI", targets: ["GitHubAPI"]),
],
dependencies: [
.package(url: "https://github.com/apollographql/apollo-ios.git", from: "1.0.0"),
.package(url: "https://github.com/apollographql/apollo-ios", exact: "1.16.1"),
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,15 @@ import ApolloAPI

public extension Interfaces {
/// Represents an object which can take actions on GitHub. Typically a User or Bot.
static let Actor = ApolloAPI.Interface(name: "Actor", keyFields: nil)
static let Actor = ApolloAPI.Interface(
name: "Actor",
keyFields: nil,
implementingObjects: [
"Bot",
"EnterpriseUserAccount",
"Mannequin",
"Organization",
"User"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ import ApolloAPI

public extension Interfaces {
/// An object that can have users assigned to it.
static let Assignable = ApolloAPI.Interface(name: "Assignable", keyFields: nil)
static let Assignable = ApolloAPI.Interface(
name: "Assignable",
keyFields: nil,
implementingObjects: [
"Issue",
"PullRequest"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,68 @@ import ApolloAPI

public extension Interfaces {
/// An entry in the audit log.
static let AuditEntry = ApolloAPI.Interface(name: "AuditEntry", keyFields: nil)
static let AuditEntry = ApolloAPI.Interface(
name: "AuditEntry",
keyFields: nil,
implementingObjects: [
"MembersCanDeleteReposClearAuditEntry",
"MembersCanDeleteReposDisableAuditEntry",
"MembersCanDeleteReposEnableAuditEntry",
"OauthApplicationCreateAuditEntry",
"OrgAddBillingManagerAuditEntry",
"OrgAddMemberAuditEntry",
"OrgBlockUserAuditEntry",
"OrgConfigDisableCollaboratorsOnlyAuditEntry",
"OrgConfigEnableCollaboratorsOnlyAuditEntry",
"OrgCreateAuditEntry",
"OrgDisableOauthAppRestrictionsAuditEntry",
"OrgDisableSamlAuditEntry",
"OrgDisableTwoFactorRequirementAuditEntry",
"OrgEnableOauthAppRestrictionsAuditEntry",
"OrgEnableSamlAuditEntry",
"OrgEnableTwoFactorRequirementAuditEntry",
"OrgInviteMemberAuditEntry",
"OrgInviteToBusinessAuditEntry",
"OrgOauthAppAccessApprovedAuditEntry",
"OrgOauthAppAccessDeniedAuditEntry",
"OrgOauthAppAccessRequestedAuditEntry",
"OrgRemoveBillingManagerAuditEntry",
"OrgRemoveMemberAuditEntry",
"OrgRemoveOutsideCollaboratorAuditEntry",
"OrgRestoreMemberAuditEntry",
"OrgUnblockUserAuditEntry",
"OrgUpdateDefaultRepositoryPermissionAuditEntry",
"OrgUpdateMemberAuditEntry",
"OrgUpdateMemberRepositoryCreationPermissionAuditEntry",
"OrgUpdateMemberRepositoryInvitationPermissionAuditEntry",
"PrivateRepositoryForkingDisableAuditEntry",
"PrivateRepositoryForkingEnableAuditEntry",
"RepoAccessAuditEntry",
"RepoAddMemberAuditEntry",
"RepoAddTopicAuditEntry",
"RepoArchivedAuditEntry",
"RepoChangeMergeSettingAuditEntry",
"RepoConfigDisableAnonymousGitAccessAuditEntry",
"RepoConfigDisableCollaboratorsOnlyAuditEntry",
"RepoConfigDisableContributorsOnlyAuditEntry",
"RepoConfigDisableSockpuppetDisallowedAuditEntry",
"RepoConfigEnableAnonymousGitAccessAuditEntry",
"RepoConfigEnableCollaboratorsOnlyAuditEntry",
"RepoConfigEnableContributorsOnlyAuditEntry",
"RepoConfigEnableSockpuppetDisallowedAuditEntry",
"RepoConfigLockAnonymousGitAccessAuditEntry",
"RepoConfigUnlockAnonymousGitAccessAuditEntry",
"RepoCreateAuditEntry",
"RepoDestroyAuditEntry",
"RepoRemoveMemberAuditEntry",
"RepoRemoveTopicAuditEntry",
"RepositoryVisibilityChangeDisableAuditEntry",
"RepositoryVisibilityChangeEnableAuditEntry",
"TeamAddMemberAuditEntry",
"TeamAddRepositoryAuditEntry",
"TeamChangeParentTeamAuditEntry",
"TeamRemoveMemberAuditEntry",
"TeamRemoveRepositoryAuditEntry"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,14 @@ import ApolloAPI

public extension Interfaces {
/// An object that can be closed
static let Closable = ApolloAPI.Interface(name: "Closable", keyFields: nil)
static let Closable = ApolloAPI.Interface(
name: "Closable",
keyFields: nil,
implementingObjects: [
"Issue",
"Milestone",
"Project",
"PullRequest"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,19 @@ import ApolloAPI

public extension Interfaces {
/// Represents a comment.
static let Comment = ApolloAPI.Interface(name: "Comment", keyFields: nil)
static let Comment = ApolloAPI.Interface(
name: "Comment",
keyFields: nil,
implementingObjects: [
"CommitComment",
"GistComment",
"Issue",
"IssueComment",
"PullRequest",
"PullRequestReview",
"PullRequestReviewComment",
"TeamDiscussion",
"TeamDiscussionComment"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,17 @@ import ApolloAPI

public extension Interfaces {
/// Entities that can be deleted.
static let Deletable = ApolloAPI.Interface(name: "Deletable", keyFields: nil)
static let Deletable = ApolloAPI.Interface(
name: "Deletable",
keyFields: nil,
implementingObjects: [
"CommitComment",
"GistComment",
"IssueComment",
"PullRequestReview",
"PullRequestReviewComment",
"TeamDiscussion",
"TeamDiscussionComment"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,18 @@ import ApolloAPI

public extension Interfaces {
/// Metadata for an audit entry containing enterprise account information.
static let EnterpriseAuditEntryData = ApolloAPI.Interface(name: "EnterpriseAuditEntryData", keyFields: nil)
static let EnterpriseAuditEntryData = ApolloAPI.Interface(
name: "EnterpriseAuditEntryData",
keyFields: nil,
implementingObjects: [
"MembersCanDeleteReposClearAuditEntry",
"MembersCanDeleteReposDisableAuditEntry",
"MembersCanDeleteReposEnableAuditEntry",
"OrgInviteToBusinessAuditEntry",
"PrivateRepositoryForkingDisableAuditEntry",
"PrivateRepositoryForkingEnableAuditEntry",
"RepositoryVisibilityChangeDisableAuditEntry",
"RepositoryVisibilityChangeEnableAuditEntry"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,14 @@ import ApolloAPI

public extension Interfaces {
/// Represents a Git object.
static let GitObject = ApolloAPI.Interface(name: "GitObject", keyFields: nil)
static let GitObject = ApolloAPI.Interface(
name: "GitObject",
keyFields: nil,
implementingObjects: [
"Blob",
"Commit",
"Tag",
"Tree"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ import ApolloAPI

public extension Interfaces {
/// An object that can have labels assigned to it.
static let Labelable = ApolloAPI.Interface(name: "Labelable", keyFields: nil)
static let Labelable = ApolloAPI.Interface(
name: "Labelable",
keyFields: nil,
implementingObjects: [
"Issue",
"PullRequest"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ import ApolloAPI

public extension Interfaces {
/// An object that can be locked.
static let Lockable = ApolloAPI.Interface(name: "Lockable", keyFields: nil)
static let Lockable = ApolloAPI.Interface(
name: "Lockable",
keyFields: nil,
implementingObjects: [
"Issue",
"PullRequest"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ import ApolloAPI

public extension Interfaces {
/// Entities that have members who can set status messages.
static let MemberStatusable = ApolloAPI.Interface(name: "MemberStatusable", keyFields: nil)
static let MemberStatusable = ApolloAPI.Interface(
name: "MemberStatusable",
keyFields: nil,
implementingObjects: [
"Organization",
"Team"
]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,14 @@ import ApolloAPI

public extension Interfaces {
/// Entities that can be minimized.
static let Minimizable = ApolloAPI.Interface(name: "Minimizable", keyFields: nil)
static let Minimizable = ApolloAPI.Interface(
name: "Minimizable",
keyFields: nil,
implementingObjects: [
"CommitComment",
"GistComment",
"IssueComment",
"PullRequestReviewComment"
]
)
}
Loading
Loading