Unions

In this article

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.

About unions

A union is a type of object representing many objects.

For example, a field marked as an ProjectCardItem could be an Issue or a PullRequest because each of those objects can be inside a project card. Using a union instead of an object gives you flexibility.

For more information, see "Introduction to GraphQL."

Assignee

Types that can be assigned to issues.

Possible types


AuditEntryActor

Types that can initiate an audit log event.

Possible types


Closer

The object which triggered a ClosedEvent.

Possible types


CreatedIssueOrRestrictedContribution

Represents either a issue the viewer can access or a restricted contribution.


CreatedPullRequestOrRestrictedContribution

Represents either a pull request the viewer can access or a restricted contribution.


CreatedRepositoryOrRestrictedContribution

Represents either a repository the viewer can access or a restricted contribution.


EnterpriseMember

An object that is a member of an enterprise.

Possible types


IpAllowListOwner

Types that can own an IP allow list.

Possible types


IssueOrPullRequest

Used for return value of Repository.issueOrPullRequest.

Possible types


MilestoneItem

Types that can be inside a Milestone.

Possible types


OrganizationAuditEntry

An audit entry in an organization audit log.

Possible types


PermissionGranter

Types that can grant permissions on a repository to a user.

Possible types


PinnableItem

Types that can be pinned to a profile page.

Possible types


ProjectCardItem

Types that can be inside Project Cards.

Possible types


PullRequestTimelineItems

An item in a pull request timeline.

Possible types


PushAllowanceActor

Types that can be an actor.

Possible types


ReferencedSubject

Any referencable object.

Possible types


RenamedTitleSubject

An object which has a renamable title.

Possible types


RequestedReviewer

Types that can be requested reviewers.

Possible types


ReviewDismissalAllowanceActor

Types that can be an actor.

Possible types


Entites that can sponsor others via GitHub Sponsors.

Possible types


StatusCheckRollupContext

Types that can be inside a StatusCheckRollup context.

Possible types


Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.