图形交互式浏览器中的GraphQL IDE。 试试现场演示。
特性:
- 语法突出显示
- 智能类型优先于字段,参数,类型等。
- 实时错误突出显示和报告。
- 自动查询完成。
- 运行并检查查询结果。
入门
使用node.js服务器?只需使用express-graphql!它可以自动呈现GraphiQL。使用另一个GraphQL服务? GraphiQL很容易设置。用npm:
npm install --save graphiql
或者,如果您使用yarn:
yarn add graphiql
GraphiQL提供了一个负责呈现UI的React组件,该组件应提供从GraphQL获取的功能,我们建议使用fetch标准API。
import React from 'react';
import ReactDOM from 'react-dom';
import GraphiQL from 'graphiql';
import fetch from 'isomorphic-fetch';
function graphQLFetcher(graphQLParams) {
return fetch(window.location.origin + '/graphql', {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(graphQLParams),
}).then(response => response.json());
}
ReactDOM.render(, document.body);
GraphQL是一个用于api的查询语言,也是用于使用现有数据来实现这些查询的运行环境。GraphQL为您的API提供了一个完整的、可理解的数据描述,让客户能够准确地询问他们需要什么,什么也不需要,这使得随着时间的推移,开发API变得更加容易,并且能够支持强大的开发工具。
许多不同的编程语言支持GraphQL。 列表(http://graphql.org/code/#graphql-clients)包含一些更流行的服务器端框架,客户端库,服务和其他有用的东西。
服务器库
除了JavaScript中的GraphQL参考实现之外,服务器库还包括:
GraphQL Clients
Tools
- graphiql (npm): An interactive in-browser GraphQL IDE.
- libgraphqlparser: A GraphQL query language parser in C++ with C and C++ APIs.
- Graphql Language Service: An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).
Services
- Apollo Optics: A service for monitoring the performance and usage of your GraphQL backend.
- GraphCMS: A BaaS (Backend as a Service) that sets you up with a GraphQL backend as well as tools for content editors to work with the stored data.
- Graphcool (github): A BaaS (Backend as a Service) providing a GraphQL backend for your applications with a powerful web ui for managing your database and stored data.
- Reindex (github): A BaaS (Backend as a Service) that sets you up with a GraphQL backend targeted at applications using React and Relay.
- Scaphold (github): A BaaS (Backend as a Service) that sets you up with a GraphQL backend for your applications with many different integrations.
More Stuff
- awesome-graphql: A fantastic community maintained collection of libraries, resources, and more.