我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

查询

本文内容

关于查询

每个 GraphQL 架构的查询和突变都有根类型。 查询类型可定义从服务器中检索数据的 GraphQL 操作。

更多信息请参阅“关于查询。”

注: 对于 用户到服务器 GitHub 应用程序 请求,您应该使用单独的查询来处理问题和拉取请求。 例如,使用 is:issueis:pull-request 过滤器及其等效功能。 使用 search 连接在单一查询中返回问题和拉取请求的组合将产生一组空节点。

连接

marketplaceListings

类型: MarketplaceListingConnection!

Look up Marketplace listings.

参数

名称 描述

adminId (ID)

Select listings that can be administered by the specified user.

after (String)

Returns the elements in the list that come after the specified cursor.

allStates (Boolean)

Select listings visible to the viewer even if they are not approved. If omitted or false, only approved listings will be returned.

before (String)

Returns the elements in the list that come before the specified cursor.

categorySlug (String)

Select only listings with the given category.

first (Int)

Returns the first n elements from the list.

last (Int)

Returns the last n elements from the list.

organizationId (ID)

Select listings for products owned by the specified organization.

primaryCategoryOnly (Boolean)

Select only listings where the primary category matches the given category slug.

The default value is false.

slugs ([String])

Select the listings with these slugs, if they are visible to the viewer.

useTopicAliases (Boolean)

Also check topic aliases for the category slug.

viewerCanAdmin (Boolean)

Select listings to which user has admin access. If omitted, listings visible to the viewer are returned.

withFreeTrialsOnly (Boolean)

Select only listings that offer a free trial.

The default value is false.


search

类型: SearchResultItemConnection!

Perform a search across resources.

参数

名称 描述

after (String)

Returns the elements in the list that come after the specified cursor.

before (String)

Returns the elements in the list that come before the specified cursor.

first (Int)

Returns the first n elements from the list.

last (Int)

Returns the last n elements from the list.

query (String!)

The search string to look for.

type (SearchType!)

The types of search items to search within.


securityAdvisories

类型: SecurityAdvisoryConnection!

GitHub Security Advisories.

参数

名称 描述

after (String)

Returns the elements in the list that come after the specified cursor.

before (String)

Returns the elements in the list that come before the specified cursor.

first (Int)

Returns the first n elements from the list.

identifier (SecurityAdvisoryIdentifierFilter)

Filter advisories by identifier, e.g. GHSA or CVE.

last (Int)

Returns the last n elements from the list.

orderBy (SecurityAdvisoryOrder)

Ordering options for the returned topics.

publishedSince (DateTime)

Filter advisories to those published since a time in the past.

updatedSince (DateTime)

Filter advisories to those updated since a time in the past.


securityVulnerabilities

类型: SecurityVulnerabilityConnection!

Software Vulnerabilities documented by GitHub Security Advisories.

参数

名称 描述

after (String)

Returns the elements in the list that come after the specified cursor.

before (String)

Returns the elements in the list that come before the specified cursor.

ecosystem (SecurityAdvisoryEcosystem)

An ecosystem to filter vulnerabilities by.

first (Int)

Returns the first n elements from the list.

last (Int)

Returns the last n elements from the list.

orderBy (SecurityVulnerabilityOrder)

Ordering options for the returned topics.

package (String)

A package name to filter vulnerabilities by.

severities ([SecurityAdvisorySeverity!])

A list of severities to filter vulnerabilities by.


字段

codeOfConduct

类型: CodeOfConduct

Look up a code of conduct by its key.

参数

名称 描述

key (String!)

The code of conduct's key.


codesOfConduct

类型: [CodeOfConduct]

Look up a code of conduct by its key.


enterprise

类型: Enterprise

Look up an enterprise by URL slug.

参数

名称 描述

invitationToken (String)

The enterprise invitation token.

slug (String!)

The enterprise URL slug.


enterpriseAdministratorInvitation

类型: EnterpriseAdministratorInvitation

Look up a pending enterprise administrator invitation by invitee, enterprise and role.

参数

名称 描述

enterpriseSlug (String!)

The slug of the enterprise the user was invited to join.

role (EnterpriseAdministratorRole!)

The role for the business member invitation.

userLogin (String!)

The login of the user invited to join the business.


enterpriseAdministratorInvitationByToken

类型: EnterpriseAdministratorInvitation

Look up a pending enterprise administrator invitation by invitation token.

参数

名称 描述

invitationToken (String!)

The invitation token sent with the invitation email.


license

类型: License

Look up an open source license by its key.

参数

名称 描述

key (String!)

The license's downcased SPDX ID.


licenses

类型: [License]!

Return a list of known open source licenses.


marketplaceCategories

类型: [MarketplaceCategory!]!

Get alphabetically sorted list of Marketplace categories.

参数

名称 描述

excludeEmpty (Boolean)

Exclude categories with no listings.

excludeSubcategories (Boolean)

Returns top level categories only, excluding any subcategories.

includeCategories ([String!])

Return only the specified categories.


marketplaceCategory

类型: MarketplaceCategory

Look up a Marketplace category by its slug.

参数

名称 描述

slug (String!)

The URL slug of the category.

useTopicAliases (Boolean)

Also check topic aliases for the category slug.


marketplaceListing

类型: MarketplaceListing

Look up a single Marketplace listing.

参数

名称 描述

slug (String!)

Select the listing that matches this slug. It's the short name of the listing used in its URL.


meta

类型: GitHubMetadata!

Return information about the GitHub instance.


node

类型: Node

Fetches an object given its ID.

参数

名称 描述

id (ID!)

ID of the object.


nodes

类型: [Node]!

Lookup nodes by a list of IDs.

参数

名称 描述

ids ([ID!]!)

The list of node IDs.


organization

类型: Organization

Lookup a organization by login.

参数

名称 描述

login (String!)

The organization's login.


rateLimit

类型: RateLimit

The client's rate limit information.

参数

名称 描述

dryRun (Boolean)

If true, calculate the cost for the query without evaluating it.

The default value is false.


relay

类型: Query!

Hack to workaround https://github.com/facebook/relay/issues/112 re-exposing the root query object.


repository

类型: Repository

Lookup a given repository by the owner and repository name.

参数

名称 描述

name (String!)

The name of the repository.

owner (String!)

The login field of a user or organization.


repositoryOwner

类型: RepositoryOwner

Lookup a repository owner (ie. either a User or an Organization) by login.

参数

名称 描述

login (String!)

The username to lookup the owner by.


resource

类型: UniformResourceLocatable

Lookup resource by a URL.

参数

名称 描述

url (URI!)

The URL.


securityAdvisory

类型: SecurityAdvisory

Fetch a Security Advisory by its GHSA ID.

参数

名称 描述

ghsaId (String!)

GitHub Security Advisory ID.


sponsorsListing

类型: SponsorsListing

Look up a single Sponsors Listing.

废弃通知

sponsorsListing is deprecated.

Query.sponsorsListing will be removed. Use Sponsorable.sponsorsListing instead. Removal on 2020-04-01 UTC.

参数

名称 描述

slug (String!)

Select the Sponsors listing which matches this slug.


topic

类型: Topic

Look up a topic by name.

参数

名称 描述

name (String!)

The topic's name.


user

类型: User

Lookup a user by login.

参数

名称 描述

login (String!)

The user's login.


viewer

类型: User!

The currently authenticated user.


此文档对您有帮助吗?

Privacy policy

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。