crystal README

The project's README from github.com/graphile/crystal. As one markdown file: README.md.

🔮 Graphile's Crystal Monorepo

GitHub Sponsors Discord chat room Follow Follow

At Graphile we love GraphQL so much we named ourself for our love of it! This repository houses many of the Graphile packages that relate to GraphQL (or relate to the packages that relate to GraphQL, or relate to those package...); the two headline projects are Grafast and PostGraphile but there's many other packages, a fair few of which can be used independently - see below for more details.

Grafast: A cutting-edge planning and execution engine for GraphQL.js ─ use this as a drop-in replacement for the execute method from GraphQL.js and by moving from traditional resolvers to Grafast "plan resolvers" you'll be able to leverage the declarative nature of GraphQL requests to execute your business logic in the most efficient way, leading to reduced server load and happier customers. Use this if you're building your own GraphQL schemas and want the best performance and efficiency without having to put much extra effort in.

PostGraphile: An incredibly low-effort way to build a well structured and high-performance GraphQL API backed primarily by a PostgreSQL database. Our main focusses are performance, automatic best-practices and customisability/extensibility. Use this if you have a PostgreSQL database and you want to use it as the "source of truth" for an auto-generated GraphQL API (which you can still make significant changes to). NOTE: thanks to graphile-export you can also use this as a starting point for an API that you then manage yourself.

➡️ For PostGraphile V4 see the legacy branch

Project summaries

Here's a rough breakdown of the main packages:

Crowd-funded open-source software

To help us develop this software sustainably, we ask all individuals and businesses that use it to help support its ongoing maintenance and development via sponsorship.

Click here to find out more about sponsors and sponsorship.

And please give some love to our featured sponsors 🤩:

Steelhead
Steelhead
*

* Sponsors the entire Graphile suite

Why the "crystal" monorepo?

Originally what is now Grafast (and was previously DataPlanner) was known by the codename "Graphile Crystal." This lead us to use the 🔮 emoji to represent the project in secret before we announced it publicly, as a codeword for those in the know. Now that Grafast is the name for our planning and execution engine and we needed a name for the monorepo that wasn't too GraphQL specific (since there are things in here that aren't strictly related to GraphQL) and we figured that calling it the Crystal monorepo would honour our original nickname for the project. Rumours that the name was inspired by the maintainers' crystal wedding anniversary are greatly exaggerated.

crystal (graphile/crystal)

Searching Database…

12.9K ·GitHub
这是什么?Graphile 的 Crystal 单体仓库汇集了他们的多个 GraphQL 相关包,其中最主要的是 Grafast(为 GraphQL.js 提供规划与执行引擎)和 PostGraphile(可根据 PostgreSQL 数据库自动生成高性能的 GraphQL API),另外还有许多配套库。
这是一个库,还是一组独立的包?它是一个单体仓库,包含许多可以独立发布的 npm 包,例如 Grafast、PostGraphile、@dataplan/pg、pg-sql2、pg-introspection、graphile-build 等,其中有几个可以单独安装和使用。
我该怎么选择要安装的包?只需从 npm 安装你需要的那个包即可:'postgraphile' 是从数据库到 API 的完整工具;'grafast' 可以为你自己的 GraphQL.js schema 加上高速执行引擎;如果你想自己编写 SQL 或检查 Postgres 结构,可以使用 'pg-sql2' 和 'pg-introspection' 这类更底层的工具。
使用这些包一定需要 PostgreSQL 数据库吗?只有面向 Postgres 的包才需要,包括 PostGraphile、@dataplan/pg、pg-sql2、pg-introspection 和 graphile-build-pg,它们都要配合 PostgreSQL 数据库使用。Grafast 本身是通用的 GraphQL.js 执行引擎,不需要 Postgres。
较旧的 PostGraphile V4 怎么样了?V4 已转移到单独的 legacy 分支;本仓库的 main 分支现在包含基于 Grafast 构建的新版本。
为什么这个单体仓库叫 'Crystal'?Grafast 最初的代号是 'Graphile Crystal',在正式公布之前曾被当作保密的代号使用,因此维护者便以这个昵称为单体仓库命名。
在常规的 GraphQL.js 配置中,Grafast 替代的是什么?它是 GraphQL.js 的 execute 函数的直接替代品,允许你编写声明式的 '规划解析器'(plan resolvers),而不是传统的解析器,从而实现更高效的查询执行。
以后我能不再使用 PostGraphile 自动生成的 schema,改为自己维护代码吗?可以。graphile-export 包可以把内存中动态构建的 GraphQL schema 导出为普通的 JavaScript 源代码,之后你就可以导入并自行维护这些代码。
Creator
graphile
Size
124.9 MB
Stars
12.9K
Age
10y
Commits · 90 Days