zoukankan      html  css  js  c++  java
  • [简记] github 上的 GraphQL v4 API

    突发奇想,想用github做一个支持rss的blog体系,或者就是知识管理体系,简单看了下,把测试用的暂存起来

    # Type queries into this side of the screen, and you will 
    # see intelligent typeaheads aware of the current GraphQL type schema, 
    # live syntax, and validation errors highlighted within the text.
    
    # We'll get you started with a simple query showing your username!
    query { 
      viewer { 
        login
      }
      repository(owner:"hsxfjames", name:"SCNUSE-Beginners-Guide") {
        pullRequests(first:1) {
          totalCount
          nodes {
            title
            url
            resourcePath
            bodyHTML
            timeline(first:100) {
              totalCount
              nodes {
                ... on Commit {
                  messageBodyHTML
                  messageHeadlineHTML
                }
                ... on LabeledEvent {
                  actor {
                    login
                  }
                  label {
                    color
                    name
                  }
                }
                ... on ReferencedEvent {
                  actor {
                    login
                  }
                  commit {
                    committer {
                      name
                    }
                    messageBodyHTML
                 	  messageHeadlineHTML
                  }
                }
                ... on MergedEvent {
                  actor {
                    login
                  }
                  commit {
                    committer {
                      name
                    }
                    messageBodyHTML
                 	  messageHeadlineHTML
                  }
                  mergeRefName
                  createdAt
                }
              }
            }
          }
        }
      }
    }
    

    结果:

    {
      "data": {
        "viewer": {
          "login": "hsxfjames"
        },
        "repository": {
          "pullRequests": {
            "totalCount": 1,
            "nodes": [
              {
                "title": "来自Reborn的一些修改",
                "url": "https://github.com/hsxfjames/SCNUSE-Beginners-Guide/pull/1",
                "resourcePath": "/hsxfjames/SCNUSE-Beginners-Guide/pull/1",
                "bodyHTML": "<p>新增了一些书目,增加了一些对买书的建议</p>",
                "timeline": {
                  "totalCount": 6,
                  "nodes": [
                    {
                      "messageBodyHTML": "",
                      "messageHeadlineHTML": "test-rt"
                    },
                    {
                      "messageBodyHTML": "",
                      "messageHeadlineHTML": "test-rt"
                    },
                    {
                      "messageBodyHTML": "",
                      "messageHeadlineHTML": "test-rt"
                    },
                    {
                      "actor": {
                        "login": "hsxfjames"
                      },
                      "label": {
                        "color": "84b6eb",
                        "name": "enhancement"
                      }
                    },
                    {
                      "actor": {
                        "login": "hsxfjames"
                      },
                      "commit": {
                        "committer": {
                          "name": "Black Strom"
                        },
                        "messageBodyHTML": "",
                        "messageHeadlineHTML": "新增了一些书目,增加了一些对买书的建议 (<a href="https://github.com/hsxfjames/SCNUSE-Beginners-Guide/pull/1" class="issue-link js-issue-link" data-url="https://github.com/hsxfjames/SCNUSE-Beginners-Guide/issues/1" data-id="244392967" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#1</a>)"
                      }
                    },
                    {
                      "actor": {
                        "login": "hsxfjames"
                      },
                      "commit": {
                        "committer": {
                          "name": "Black Strom"
                        },
                        "messageBodyHTML": "",
                        "messageHeadlineHTML": "新增了一些书目,增加了一些对买书的建议 (<a href="https://github.com/hsxfjames/SCNUSE-Beginners-Guide/pull/1" class="issue-link js-issue-link" data-url="https://github.com/hsxfjames/SCNUSE-Beginners-Guide/issues/1" data-id="244392967" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#1</a>)"
                      },
                      "mergeRefName": "master",
                      "createdAt": "2017-07-21T00:47:44Z"
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }
    
  • 相关阅读:
    Java中的位运算符
    华为2019年NE40E-X8,承诺命令
    华为网络设备修改console密码
    MySQL5.7 多实例
    华为防火墙域间策略全开命令
    Linux基础命令---ntpstat显示时间服务器同步
    【转载】Java程序模拟公安局人员管理系统
    redis cluster集群动态伸缩--删除主从节点
    DBUtils的使用之查询的操作
    服务治理-Resilience4j(限流)
  • 原文地址:https://www.cnblogs.com/BlackStorm/p/7216269.html
Copyright © 2011-2022 走看看