graphql

GitHub API v4: How can I traverse with pagination? (GraphQL)

萝らか妹 提交于 2020-11-26 14:48:26
问题 I'm using Github API v4 to run search query. From the API documentation I can understand that the following query gives me pageInfo but I don't know how to use it to traverse. query { search(first: 100, type:USER, query:"location:usa repos:>0 language:java") { pageInfo { startCursor hasNextPage endCursor } userCount nodes { ... on User { bio company email id isBountyHunter isCampusExpert isDeveloperProgramMember isEmployee isHireable isSiteAdmin isViewer location login name url websiteUrl } }

GitHub API v4: How can I traverse with pagination? (GraphQL)

徘徊边缘 提交于 2020-11-26 14:32:39
问题 I'm using Github API v4 to run search query. From the API documentation I can understand that the following query gives me pageInfo but I don't know how to use it to traverse. query { search(first: 100, type:USER, query:"location:usa repos:>0 language:java") { pageInfo { startCursor hasNextPage endCursor } userCount nodes { ... on User { bio company email id isBountyHunter isCampusExpert isDeveloperProgramMember isEmployee isHireable isSiteAdmin isViewer location login name url websiteUrl } }

GitHub API v4: How can I traverse with pagination? (GraphQL)

谁说我不能喝 提交于 2020-11-26 14:26:59
问题 I'm using Github API v4 to run search query. From the API documentation I can understand that the following query gives me pageInfo but I don't know how to use it to traverse. query { search(first: 100, type:USER, query:"location:usa repos:>0 language:java") { pageInfo { startCursor hasNextPage endCursor } userCount nodes { ... on User { bio company email id isBountyHunter isCampusExpert isDeveloperProgramMember isEmployee isHireable isSiteAdmin isViewer location login name url websiteUrl } }

GitHub API v4: How can I traverse with pagination? (GraphQL)

纵饮孤独 提交于 2020-11-26 14:25:11
问题 I'm using Github API v4 to run search query. From the API documentation I can understand that the following query gives me pageInfo but I don't know how to use it to traverse. query { search(first: 100, type:USER, query:"location:usa repos:>0 language:java") { pageInfo { startCursor hasNextPage endCursor } userCount nodes { ... on User { bio company email id isBountyHunter isCampusExpert isDeveloperProgramMember isEmployee isHireable isSiteAdmin isViewer location login name url websiteUrl } }

GraphQL

瘦欲@ 提交于 2020-11-25 03:23:39
感谢支持ayqy个人订阅号,每周义务推送1篇( only unique one )原创精品博文,话题包括但不限于前端、Node、Android、数学(WebGL)、语文(课外书读后感)、英语(文档翻译) 如果觉得弱水三千,一瓢太少,可以去 http://blog.ayqy.net 看个痛快 写在前面 本文第一部分翻译自REST 2.0 Is Here and Its Name Is GraphQL,标题很有视觉冲击力,不小心上钩了 剩余部分是对GraphQL的思考。现在,我们边看译文边汇聚疑问 一.译文 GraphQL是一种API查询语言。虽然与REST有本质区别,但GraphQL可以作为REST的备选项,它提供了高性能、良好的开发体验和一些强大的工具 通过本文,我们来看看怎样用REST和GraphQL来处理一些常见场景。本文附有3个项目,提供了流行电影和演员信息API,还用HTML和jQuery搭了个简单的前端应用,可以查看对应的REST和GraphQL源码 我们将通过这些API来看这两种技术的差异,以便了解其优缺点。开始之前,先布置舞台,快速过一下这些技术是怎么冒出来的 Web早期 Web早期很简单,早期的Web应用就是静态HTML文档。演化到网站想包含存在数据库(例如SQL)里的动态内容,并通过JavaScript来添加交互功能

[GraphQL] Query a GraphQL API with graphql-request

不打扰是莪最后的温柔 提交于 2020-11-24 15:05:03
To query a GraphQL API, all you need to do is send an HTTP request that includes the query operation in the body of the request. In this lesson, we will use the browser’s fetch method to request the total days skied from our GraphQL API. const query = ` query { totalDays } `; console.log( "querying the count" ); fetch( "https://8lq1n313m2.sse.codesandbox.io" , { method: "POST" , headers: { "Content-Type": "application/json" }, body: JSON.stringify({ query }) }) .then(res => res.json()) .then(({ data }) => `totalDays: ${data.totalDays}`) .then(console.log) . catch (console.error); graphql