当前位置: 首页 > 软件库 > 大数据 > 数据查询 >

graphql-binding-github

授权协议 Readme
开发语言 Java
所属分类 大数据、 数据查询
软件类型 开源软件
地区 不详
投 递 者 魏熠彤
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

GraphQL Binding for GitHub

Embed GitHub's GraphQL API into your server application

Deprecation Notice!

In the last few months, since the transition of many libraries under The Guild's leadership, We've reviewed and released many improvements and versions to graphql-cli, graphql-config and graphql-import.

We've reviewed graphql-binding, had many meetings with current users and engaged the community also through the roadmap issue.

What we've found is that the new GraphQL Mesh library is covering not only all the current capabilities of GraphQL Binding, but also the future ideas that were introduced in the original GraphQL Binding blog post and haven't come to life yet.

And the best thing - GraphQL Mesh gives you all those capabilities, even if your source is not a GraphQL service at all!
it can be GraphQL, OpenAPI/Swagger, gRPC, SQL or any other source!And of course you can even merge all those sources into a single SDK.

Just like GraphQL Binding, you get a fully typed SDK (thanks to the protocols SDKs and the GraphQL Code Generator), but from any source, and that SDK can run anywhere, as a connector or as a full blown gateway.And you can share your own "Mesh Modules" (which you would probably call "your own binding") and our community already created many of those!Also, we decided to simply expose regular GraphQL, so you can choose how to consume it using all the awesome fluent client SDKs out there.

If you think that we've missed anything from GraphQL Binding that is not supported in a better way in GraphQL Mesh, please let us know!

Install

yarn add graphql-binding-github

Example (Demo)

See example directory for full example application.

const { GitHub } = require('graphql-binding-github')
const { GraphQLServer } = require('graphql-yoga')
const { importSchema } = require('graphql-import')

const favoriteRepos = [
  { owner: 'graphcool', name: 'graphql-yoga' },
  { owner: 'graphql', name: 'graphql-js' },
]

const token = '__ENTER_YOUR_GITHUB_TOKEN__'
const github = new GitHub(token)

const typeDefs = importSchema('schemas/app.graphql')
const resolvers = {
  Query: {
    hello: (parent, { name }) => `Hello ${name || 'World'}!`,
    favoriteRepos: (parent, args, context, info) => {
      return Promise.all(
        favoriteRepos.map(args => github.query.repository(args, context, info)),
      )
    },
  },
  // the following is needed to make interfaces, unions & custom scalars work
  ...github.getAbstractResolvers(typeDefs),
}

const server = new GraphQLServer({ resolvers, typeDefs })
server.start(() => console.log('Server running on http://localhost:4000'))

How to create a GitHub Token

Simply follow this guide and head over to the token settings on GitHub.

Resources

  • 模块 npm install -g get-graphql-schema get-graphql-schema GRAPHQL_URL > schema.graphql 简单使用 使用prisma cli prisma init appdemo cd appdmeo docker-compose up -d prisma deploy 使用 get-graphql-schema http://lo

  • graphql by Michael Hunger 迈克尔·汉格(Michael Hunger) 在GraphQL社区中发现很棒的女工程师 (Discovering Awesome Female Engineers in the GraphQL Community) 对社区图项目和性别API的有趣使用 (An interesting use of our community-graph proje

  • ruby on rails The author selected Free Press to receive a donation as part of the Write for DOnations program. 作者选择Free Press作为Write for DOnations计划的一部分接受捐赠。 介绍 (Introduction) GraphQL is a strongly ty

 相关资料
  • Binding中间件提供了自动提取请求参数到结构体的映射和要求检查。他是一个 Tango 的中间件。 安装 go get github.com/tango-contrib/binding 示例 import ( "github.com/lunny/tango" "github.com/tango-contrib/binding" ) type Action struct {

  • Understand binding as reference Working with copy of data Understand binding as a reference Handsontable binds to your data source (list of arrays or list of objects) by reference (not by values, we d

  • 在本章中,我们将讨论事件绑定如何在Angular 4中工作。当用户以键盘移动,鼠标单击或鼠标悬停的形式与应用程序交互时,它会生成一个事件。 需要处理这些事件以执行某种操作。 这是事件绑定的结果。 让我们考虑一个更好地理解这一点的例子。 app.component.html <!--The content below is only a placeholder and can be replaced

  • 数据绑定可以从AngularJS,Angular 2获得,现在也可以在Angular 4中使用。 我们使用花括号进行数据绑定 - {{}}; 这个过程叫做插值。 我们在前面的例子中已经看到我们如何向变量标题声明值,并在浏览器中打印相同的值。 app.component.html文件中的变量称为{{title}},并且在app.component.ts文件和app.component.html初始化

  • Guice还提供了另一种映射绑定的方法,而无需创建自定义注释。 它允许使用@Named注释。 使用命名注释进行映射 bind(SpellChecker.class).annotatedWith(Names.named("OpenOffice")).to(OpenOfficeWordSpellCheckerImpl.class); 使用@Named注释进行注入 @Inject public Tex

  • 描述 (Description) 您可以使用它来显示可见输入和滑块,以便更改其中一个与另一个匹配。 您必须为input分配id并添加aria-controls = "idOfInput" 。 例子 (Example) 以下示例演示如何在Foundation中使用slider data binding 。 <html> <head> <title>Slider Data Bindi