Getting Start #Facebook Relay文档翻译#

公孙和怡
2023-12-01

原文地址:Getting Start
Relay文档翻译目录
To get started building Relay applications, you will need three things:
我们开始构建Relay应用,需要准备以下三项:

  1. A GraphQL Schema

    A description of your data model with an associated set of resolve methods that know how to fetch any data your application could ever need.
    它是数据模型的描述,还包含了一组相关的解析方法,用于获取应用需要的任何数据。

    GraphQL is designed to support a wide range of data access patterns. In order to understand the structure of an application’s data, Relay requires that you follow certain conventions when defining your schema. These are documented in the GraphQL Relay Specification.

    GraphQL是一种查询语言类似SQL,用于描述复杂的数据模型,并不仅为Relay使用,它设计之初就计划支持一大类数据存取模式。为了能理解应用的数据结构,Relay要求在定义schema的时候遵循一定的约定,即 GraphQL Relay Specification.

    General-purpose tools for building a GraphQL schema using JavaScript
    用JavaScript构建GraphQL schema的通用工具

    JavaScript helpers for defining connections between data, and mutations, in a way that smoothly integrates with Relay.
    与Relay无缝整合的JavaScript辅助工具,用户定义data和mutations之间的联系。

  2. A GraphQL Server

    Any server can be taught to load a schema and speak GraphQL. Our bundled examples use Express.
    任何语言、框架服务都可以作为GraphQL Server,只要提供相应功能,可以加载schema并解析GraphQL的服务器端程序即可。教程配套的例子用了Express,并开发了相应中间件express-graphql

  3. Relay

    Relay speaks to GraphQL servers through a network layer. The network layer that ships with Relay is compatible with express-graphql out of the box, and will continue to evolve as we add new features to the transport.
    Relay通过network layer与GraphQL servers通讯。network layer 负责装载Relay,可以与express-graphql轻松的配合,并且随着我们不断的增加新功能,network layer还会持续演进。

The best way to get started right now is to take a look at how these three parts come together to form a working example. The tutorial on the next page will lead you through an example application, using the Relay Starter Kit, to give you an idea of how you can start using Relay on yours.
最好的办法开始Relay之旅,是通过实例看一看这三部分是怎么整合在一起的。下一篇的tutorial将为您详细展示,该实例通过Relay Starter Kit构建。

 类似资料: