• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

graphql-js/graphene: GraphQL Framework for Javascript

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

graphql-js/graphene

开源软件地址(OpenSource Url):

https://github.com/graphql-js/graphene

开源编程语言(OpenSource Language):

TypeScript 99.7%

开源软件介绍(OpenSource Introduction):

Graphene-JS Build Status PyPI version Coverage Status

Graphene-JS is a JS framework for building GraphQL schemas/types fast and easily.

  • Easy to use: Graphene helps you use GraphQL in Javascript without effort.
  • Relay: Graphene has builtin support for Relay. (on the works)
  • Data agnostic: Graphene supports any kind of data source: SQL (Sequelize), NoSQL, custom objects, etc. We believe that by providing a complete API you could plug Graphene-JS anywhere your data lives and make your data available through GraphQL.

Check also the architecture docs to see how Graphene-JS is architected to ease the development of GraphQL in JS.

Integrations

Graphene has multiple integrations with different frameworks:

integration Package
Sequelize graphene-sequelize
TypeORM on the works

Also, Graphene is fully compatible with the GraphQL spec, working seamlessly with all GraphQL clients, such as Relay, Apollo and urql.

Installation

For instaling graphene, just run this command in your shell

npm install --save graphene-js
# or
yarn add graphene-js

Examples

Here is one example for you to get started:

import { ObjectType, Field, Schema } from "graphene-js";

@ObjectType()
class Query {
  @Field(String)
  hello() {
    return "Hello world!";
  }
}

const schema = new Schema({ query: Query });

Then Querying graphene.Schema is as simple as:

query = `
    query SayHello {
      hello
    }
`;

var result = schema.execute(query);

If you want to learn more, you can also check the documentation or check the provided examples:

Contributing

After cloning this repo, ensure dependencies are installed by running:

yarn

After developing, the full test suite can be evaluated by running:

yarn test

You can also get the coverage with:

yarn test --coverage

Documentation

The documentation is generated using the excellent Sphinx and a custom theme.

The documentation dependencies are installed by running:

cd docs
pip install -r requirements.txt

Then to produce a HTML version of the documentation:

make html



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap