- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我了解到 GitHub 基于 GraphQL 的 v4 API 比 v3 API 更高效。
对于给定的存储库,我想使用 GraphQL API 来检索:
有没有直接的方法来做到这一点?
最佳答案
是的。这样做很简单。查询看起来像:
{
repository(owner: "gatsbyjs", name: "gatsby") {
description
url
milestones(states: [OPEN],first:2) {
nodes{
title
description
url
issues(states:[OPEN,CLOSED], first:2){
nodes{
title
state
url
comments(first:2){
nodes{
url
body
createdAt
}
pageInfo{
hasNextPage
endCursor
}
}
}
pageInfo{
endCursor
hasNextPage
}
}
}
pageInfo{
endCursor
hasNextPage
}
}
}
}
注意:
对于 url 为 https://github.com/gatsbyjs/gatsby
的仓库,它的所有者是 gatsbyjs
并且它的名字是 Gatsby
转到其 API Explorer尝试微调查询。单击 Ctrl+Space 将自动建议可以检索的可用字段。
通过调整起始游标和要在 first
和 after
中返回的记录数,自己进行分页以循环遍历所有记录。
它为您提供以下内容:
{
"data": {
"repository": {
"description": "Build blazing fast, modern apps and websites with React",
"url": "https://github.com/gatsbyjs/gatsby",
"milestones": {
"nodes": [
{
"title": "Next Major",
"description": "Issues that will require a breaking change, and which would constitute being done in the next major version of Gatsby.",
"url": "https://github.com/gatsbyjs/gatsby/milestone/5",
"issues": {
"nodes": [
{
"title": "Make accessibility warnings errors",
"state": "OPEN",
"url": "https://github.com/gatsbyjs/gatsby/issues/19945",
"comments": {
"nodes": [
{
"url": "https://github.com/gatsbyjs/gatsby/issues/19945#issuecomment-568891716",
"body": "Hiya!\n\nThis issue has gone quiet. Spooky quiet. 👻\n\nWe get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.\nIf we missed this issue or if you want to keep it open, please reply here. You can also add the label \"not stale\" to keep this issue open!\nAs a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out [gatsby.dev/contribute](https://www.gatsbyjs.org/contributing/how-to-contribute/) for more information about opening PRs, triaging issues, and contributing!\n\nThanks for being a part of the Gatsby community! 💪💜",
"createdAt": "2019-12-25T12:02:26Z"
},
{
"url": "https://github.com/gatsbyjs/gatsby/issues/19945#issuecomment-570779866",
"body": "Hey again!\n\nIt’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.\nPlease keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m `HUMAN_EMOTION_SORRY`. Please feel free to reopen this issue or create a new one if you need anything else.\nAs a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out [gatsby.dev/contribute](https://www.gatsbyjs.org/contributing/how-to-contribute/) for more information about opening PRs, triaging issues, and contributing!\n\nThanks again for being part of the Gatsby community! 💪💜",
"createdAt": "2020-01-04T12:02:28Z"
}
],
"pageInfo": {
"hasNextPage": false,
"endCursor": "Y3Vyc29yOnYyOpHOIgVo2g=="
}
}
},
{
"title": "Configurable output folder",
"state": "OPEN",
"url": "https://github.com/gatsbyjs/gatsby/issues/1878",
"comments": {
"nodes": [
{
"url": "https://github.com/gatsbyjs/gatsby/issues/1878#issuecomment-324062470",
"body": "Do you have a specific use case in mind? This has been discussed before but no one has come up with a concrete use case that justified adding a new option.\r\n\r\nEvery option we add to Gatsby makes the project more complex which has all sorts of long-term costs so unless something is really valuable, I'd rather people handle this sort of thing themselves e.g. just copy the files to the output directory you want or create a symlink. This could easily be turned into a plugin that people could install, etc.",
"createdAt": "2017-08-22T15:27:41Z"
},
{
"url": "https://github.com/gatsbyjs/gatsby/issues/1878#issuecomment-324074853",
"body": "Yes, I have a use-case. I am going to use Gatsby for a documentation part as a part of complex project. All static files (Gatsby output, plus some others) should be placed into one folder `build`, that will be deployed somehow later. In other words, the Gatsby output is only one subfolder in my setup.\r\n\r\nSo far I have worked this around in `postbuild` step, but it looks hacky:\r\n\r\n```\r\n\"build\": \"gatsby build\",\r\n\"postbuild\": \"mv public build/gatsby-subsite\"\r\n```\r\nAdding configurable output folder will reduce this complexity and will help me not to move files around one more time.",
"createdAt": "2017-08-22T16:08:21Z"
}
],
"pageInfo": {
"hasNextPage": true,
"endCursor": "Y3Vyc29yOnYyOpHOE1D9ZQ=="
}
}
}
],
"pageInfo": {
"endCursor": "Y3Vyc29yOnYyOpLPgAAAAAAAArvODwULXA==",
"hasNextPage": true
}
}
}
],
"pageInfo": {
"endCursor": "Y3Vyc29yOnYyOpHOAEEbsw==",
"hasNextPage": false
}
}
}
}
}
关于graphql - 使用 GitHub GraphQL 检索里程碑的所有开放里程碑和所有问题(开放和关闭),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60232484/
下列说法正确的是: Javascript == Typescript Typescript != Javascript 对于 Dgraph 的 GraphQL+ 来说也是如此吗? GraphQL ==
我正在尝试通过使用 .graphql 文件并传递变量来对 Karate 进行测试。在我的 graphql 架构中,我试图重用另一个 .graphql 文件中的片段。我尝试按照 https://www.
从他们的文档中,它说: The leaf values of any request and input values to arguments are Scalars (or Enums) and
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 5 年前。 Improve
有没有一种技术可以让我在 GraphQL 中像这样声明 ADT? // TypeScript type SomeAlgebraicDataType = | { state: 'A', subSta
在基于 graphql API 构建新应用程序时,我们遇到了以下问题: 我们有一个带有输入字段的突变,其类型是具有自己验证规则的自定义标量(在这种情况下,输入是格式正确的电子邮件地址)。 在客户端,应
从语法上讲,您可以在模式中定义查询或变更,使其返回类型。 但是,操作定义(即客户端调用的查询或突变)必须有一个 SelectionSet,所以我必须这样做: mutation X { field }
我希望能听到这里专家的一些意见。我目前正在 NextJS 项目上工作,我的 graphql 正在运行在另一个 repo 中设置的模拟数据上。现在后端由其他开发人员构建,正在慢慢从模拟数据转向真实数据。
Graphql 中的架构和文档有什么区别? 架构是这样的: type Query { fo: String } 但文件是这样的: query SomeQuery { foo { ba
type Person { firstName: String!, lastName: String!, age: Int! } 如何查询所有 18 岁以上的人? 最佳答案 这
有没有办法提供 GraphQL Schema 设计的可视化图表(类似于 UML)? 背景: 我已经有了一个架构设计,要转换成 GraphQL API。但是,在开始 GraphQL 开发之前,我想创建我
我想了解 GraphQL 的(Java)实现是否足够智能,如果在其中一个提取器的执行期间抛出异常,可以取消预定的数据提取? 例如,我运行一个查询来检索客户的所有订单。假设客户有 100 个订单。这意味
我是graphql的新手,但是我在努力查询。 我想通过他们的电子邮件地址返回用户 我有一个类型定义的调用V1User,它具有以下字段 ID, 电子邮件, 密码, 角色 要根据电子邮件返回用户,此查询中
我将GraphQL包装器放在现有的REST API上,如Zero to GraphQL in 30 minutes中所述。我有一个产品的API端点,该端点具有一个指向嵌套对象的属性: // API R
在 GraphQL 中,空格似乎很重要,因为它分隔 token : { human(id: "1000") { name height } } 然而,spec says那个空格
我正在尝试使用带有属性的 sequelize 获取数据并将其传递给 graphql。 结果在控制台中很好,但 graphql 查询为属性字段返回 null。 我的解析器 getUnpayedL
有没有办法在 graphql 查询中生成静态值? 例如,假设我有一个 user具有名称和电子邮件字段的对象。出于某种原因,我总是希望用户的状态为“已接受”。我怎样才能写一个查询来完成这个? 我想做的事
我已关注 the documentation about using graphql-tools to mock a GraphQL server ,但是这会引发自定义类型的错误,例如: Expect
我今天在生产中有以下 graphql 模式定义: type BasketPrice { amount: Int! currency: String! } type BasketItem {
像这样的graphql模式: type User { id: ID! location: Location } type Location { id: ID! user: User }
我是一名优秀的程序员,十分优秀!