+
+ )
+}
+
+export default index
diff --git a/src/components/HeaderLinks/index.tsx b/src/components/HeaderLinks/index.tsx
index d939ce6a95..720da9f49f 100644
--- a/src/components/HeaderLinks/index.tsx
+++ b/src/components/HeaderLinks/index.tsx
@@ -11,6 +11,7 @@ const links: LinkItem[] = [
{ section: "learn", text: "Learn", href: "/learn/" },
{ section: "code", text: "Code", href: "/code/" },
{ section: "community", text: "Community", href: "/community/" },
+ { section: "faq", text: "FAQ", href: "/faq/" },
{
section: "spec",
text: "Spec",
diff --git a/src/content/faq/General.md b/src/content/faq/General.md
new file mode 100644
index 0000000000..35cee2fffd
--- /dev/null
+++ b/src/content/faq/General.md
@@ -0,0 +1,81 @@
+---
+title: Frequently Asked Questions (FAQ)
+layout: faq
+category: General
+permalink: /faq/
+questions: Why should I use GraphQL?,Is GraphQL a database language like SQL?,Does GraphQL replace REST?,How can I learn GraphQL?,Is GraphQL frontend or backend?,Is GraphQL only for React or JavaScript developers?,What is a GraphQL client and why would I use one?,Is GraphQL owned by Facebook?,What is the GraphQL Foundation?,How can I contribute to the GraphQL specification?
+---
+
+## Why should I use GraphQL?
+
+It depends on your use case, but in general, GraphQL has a few key features that stand out. For example, GraphQL enables you to:
+
+* Aggregate data from [multiple UI components](/learn/queries/#fragments).
+* Create a representation of your data that feels familiar and natural ([a graph](/learn/thinking-in-graphs/#it-s-graphs-all-the-way-down)).
+* Ensure that all of your data is [statically typed](/learn/schema/) and these types inform [what queries the schema supports](/learn/introspection/).
+* [Reduce the need for breaking changes](/learn/best-practices/#versioning), but utilize a [built-in mechanism for deprecations](https://spec.graphql.org/draft/#sec-Deprecation) when you need to.
+* Access to a [powerful tooling ecosystem](/code/#tools) with GUIs, editor integrations, code generation, linting, analytics, and more.
+
+[Our homepage](/) outlines even more reasons to use GraphQL.
+
+You can try out GraphQL without rewriting your entire application. For example, starting with a single HTTP request that wraps an existing REST call. Your [GraphQL schema](/learn/thinking-in-graphs/#shared-language) and [business domain model](/learn/thinking-in-graphs/#business-logic-layer) can expand gradually. We recommend focusing on one use case at first and only building the part of the schema needed for that.
+
+## Is GraphQL a database language like SQL?
+
+No, but this is a common misconception.
+
+GraphQL is a specification typically used for remote client-server communications. Unlike SQL, GraphQL is agnostic to the data source(s) used to retrieve data and persist changes. Accessing and manipulating data is performed with arbitrary functions called [resolvers](/learn/execution/). GraphQL coordinates and aggregates the data from these resolver functions, then returns the result to the client. Generally, these resolver functions should delegate to a [business logic layer](/learn/thinking-in-graphs/#business-logic-layer) responsible for communicating with the various underlying data sources. These data sources could be remote APIs, databases, [local cache](/learn/caching/), and nearly anything else your programming language can access.
+
+For more information on how to get GraphQL to interact with your database, check out our [documentation on resolvers](/learn/execution/#root-fields-resolvers).
+
+## Does GraphQL replace REST?
+
+No, not necessarily. They both handle APIs and can [serve similar purposes](/learn/thinking-in-graphs/#business-logic-layer) from a business perspective. GraphQL is often considered an alternative to REST, but it’s not a definitive replacement.
+
+GraphQL and REST can actually co-exist in your stack. For example, you can abstract REST APIs behind a [GraphQL server](https://www.howtographql.com/advanced/1-server/). This can be done by masking your REST endpoint into a GraphQL endpoint using [root resolvers](/learn/execution/#root-fields-resolvers).
+
+For an opinionated perspective on how GraphQL compares to REST, check out [How To GraphQL](https://www.howtographql.com/basics/1-graphql-is-the-better-rest/).
+
+## How can I learn GraphQL?
+
+There are many resources available to help you learn GraphQL, including this website. In [our documentation](/learn/), you’ll find a series of articles that explain essential GraphQL concepts and how they work. Our [Community page](/community) is full of resources to reference and groups to join.
+
+For more practical guides, visit the [How to GraphQL](https://www.howtographql.com/) fullstack tutorial website. We also have a free online course with edX, [Exploring GraphQL: A Query Language for APIs](https://www.edx.org/course/exploring-graphql-a-query-language-for-apis).
+
+Before you start your learning journey, make sure you know what an API is and how communication generally works between client and server.
+
+## Is GraphQL frontend or backend?
+
+Both. GraphQL specifies how you can [exchange information between client and server](https://www.howtographql.com/basics/3-big-picture/). This includes how the server can indicate [what data and operations are available](/learn/introspection/), how the client should [format requests](/learn/queries/), how the server should [execute these queries](/learn/execution/), and what the client will [receive in response](/learn/serving-over-http/#response).
+
+## Is GraphQL only for React or JavaScript developers?
+
+No, not at all. [GraphQL is a specification](https://spec.graphql.org/) that can be [implemented in any language](/learn/schema/#type-language). Our [Code page](/code/) contains a long list of libraries in many different programming languages to help with that.
+
+It’s understandable why you’d think this, though. GraphQL was introduced at a [React conference](https://www.youtube.com/watch?v=9sc8Pyc51uU) and [GraphQL.js](/graphql-js/) is one of the most widely used implementations to date. We know this can be confusing, so we’re working to improve our documentation and add more code samples that aren’t written in JavaScript.
+
+## What is a GraphQL client and why would I use one?
+
+GraphQL clients can help you handle [queries, mutations,](/learn/queries/) and [subscriptions](https://spec.graphql.org/draft/#sec-Subscription) to a [GraphQL server](https://www.howtographql.com/advanced/1-server/). They use the underlying structure of a GraphQL API to automate certain processes. This includes batching, UI updates, build-time schema validation, and more.
+
+A [list of GraphQL clients](/code/#graphql-clients) in various languages is available on our Code page. There’s also an [in-depth explanation of their benefits](https://www.howtographql.com/advanced/0-clients/) on How To GraphQL.
+
+You don't need a specific client to work with GraphQL, though. You might want to start out by [issuing GraphQL results with a regular HTTP client](/learn/serving-over-http/). Then later switch to a GraphQL-optimized client as your application grows in complexity.
+
+## Is GraphQL owned by Facebook?
+
+No, GraphQL is governed by the [GraphQL Foundation](#what-is-the-graphql-foundation).
+
+That said, the specification was originally developed at Facebook and [Facebook is a member](https://foundation.graphql.org/members/) of the GraphQL Foundation. You might notice that some of our [GitHub repositories](https://github.com/graphql/) still have the license listed under Facebook Inc. We're updating those and have already converted major projects, like [GraphiQL](https://github.com/graphql/graphiql/blob/main/LICENSE) and [DataLoader](https://github.com/graphql/dataloader/blob/master/LICENSE), to the the new copyright: "Copyright (c) 2020 GraphQL Contributors."
+
+## What is the GraphQL Foundation?
+
+The [GraphQL Foundation](https://foundation.graphql.org/faq/) is a neutral foundation that provides governance for GraphQL. This includes vendor-neutral oversight of open-source repositories, funding, events, and more. It's hosted under the [Linux Foundation](https://www.linuxfoundation.org/) and consists of [representatives from dozens of different companies](https://foundation.graphql.org/members/). The idea is that it’s an impartial and open home for the GraphQL community.
+
+You can find out more by visiting [foundation.graphql.org](https://foundation.graphql.org/).
+
+## How can I contribute to the GraphQL specification?
+
+GraphQL is still an evolving language and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub.
+
+There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation).
diff --git a/src/templates/doc.tsx b/src/templates/doc.tsx
index c22a9de1d6..e877216ccc 100644
--- a/src/templates/doc.tsx
+++ b/src/templates/doc.tsx
@@ -4,6 +4,7 @@ import Layout from "../components/Layout"
import DocsLayout from "../components/DocsLayout"
import BlogLayout from '../components/BlogLayout';
import CodeLayout from "../components/CodeLayout";
+import FAQLayout from "../components/FAQLayout";
interface Props {
data: any
@@ -14,12 +15,13 @@ const layoutMap: any = {
docs: DocsLayout,
blog: BlogLayout,
code: CodeLayout,
+ faq: FAQLayout,
}
const Blog = ({ data, pageContext }: Props) => {
const {
doc: {
- frontmatter: { title, date, permalink, byline, guestBio, layout },
+ frontmatter: { title, date, permalink, byline, guestBio, layout, questions },
rawMarkdownBody,
},
nextDoc,
@@ -33,6 +35,7 @@ const Blog = ({ data, pageContext }: Props) => {
permalink={permalink}
byline={byline}
guestBio={guestBio}
+ questions={questions}
rawMarkdownBody={rawMarkdownBody}
nextDoc={nextDoc}
sideBarData={pageContext.sideBarData}
@@ -52,6 +55,7 @@ export const query = graphql`
guestBio
sublinks
layout
+ questions
}
id
rawMarkdownBody
From ae75b89460b0350d7e4ea7c58067e2ffc0b42a38 Mon Sep 17 00:00:00 2001
From: Bora Gunes Dogan
Date: Sat, 14 Nov 2020 11:47:33 +0000
Subject: [PATCH 005/439] Typo in link for footer GraphQL Specification (#958)
---
src/components/Footer/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx
index a7bc73be6c..85fb641136 100644
--- a/src/components/Footer/index.tsx
+++ b/src/components/Footer/index.tsx
@@ -54,7 +54,7 @@ const getLinks = (sourcePath: string): FooterLinks[] => [
subsections: [
{
text: "GraphQL Specification",
- href: "/https://graphql.github.io/graphql-spec/",
+ href: "https://graphql.github.io/graphql-spec/",
},
{ text: "GraphQL Foundation", href: "https://foundation.graphql.org/" },
{
From 21f8ab22a93bfe5a2a37fcdeef4921f055301079 Mon Sep 17 00:00:00 2001
From: Carolyn Stransky
Date: Mon, 16 Nov 2020 15:24:04 +0100
Subject: [PATCH 006/439] Fix responsiveness of header (#957)
---
src/assets/css/_css/graphql.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/assets/css/_css/graphql.less b/src/assets/css/_css/graphql.less
index 5c6a807f61..9d9adc8ddc 100644
--- a/src/assets/css/_css/graphql.less
+++ b/src/assets/css/_css/graphql.less
@@ -119,7 +119,7 @@ p code {
header {
.headline-font(@size: 15px);
- height: 50px;
+ min-height: 50px;
background: white;
box-shadow: inset 0 -1px 0 0px rgba(0, 0, 0, 0.1);
z-index: 10;
From 1020b14c921435c775d60808df91aca11cc59803 Mon Sep 17 00:00:00 2001
From: Arda TANRIKULU
Date: Wed, 21 Oct 2020 05:46:01 +0300
Subject: [PATCH 007/439] Redesign Code Page
---
data/js-graphql-clients.json | 72 ++
data/js-server-libraries.json | 26 +
data/tools.json | 99 ++
gatsby-node.js | 29 +-
scripts/sort-libraries.js | 144 +++
src/{content/code/code.md => pages/code.tsx} | 841 +++++++++-------
static/img/clojure.svg | 50 +
static/img/csharp.svg | 10 +
static/img/elixir.svg | 1 +
static/img/elm.svg | 36 +
static/img/erlang.svg | 61 ++
static/img/golang.svg | 1 +
static/img/groovy.svg | 449 +++++++++
static/img/java.svg | 1 +
static/img/julia.svg | 1 +
static/img/kotlin.svg | 34 +
static/img/node.svg | 1 +
static/img/ocaml.svg | 116 +++
static/img/perl.svg | 23 +
static/img/php.svg | 96 ++
static/img/python.svg | 113 +++
static/img/r.svg | 14 +
static/img/ruby.svg | 947 +++++++++++++++++++
static/img/rust.svg | 19 +
static/img/scala.svg | 20 +
static/img/swift.svg | 10 +
26 files changed, 2861 insertions(+), 353 deletions(-)
create mode 100644 data/js-graphql-clients.json
create mode 100644 data/js-server-libraries.json
create mode 100644 data/tools.json
create mode 100644 scripts/sort-libraries.js
rename src/{content/code/code.md => pages/code.tsx} (55%)
create mode 100644 static/img/clojure.svg
create mode 100644 static/img/csharp.svg
create mode 100644 static/img/elixir.svg
create mode 100644 static/img/elm.svg
create mode 100644 static/img/erlang.svg
create mode 100644 static/img/golang.svg
create mode 100644 static/img/groovy.svg
create mode 100644 static/img/java.svg
create mode 100644 static/img/julia.svg
create mode 100644 static/img/kotlin.svg
create mode 100644 static/img/node.svg
create mode 100644 static/img/ocaml.svg
create mode 100644 static/img/perl.svg
create mode 100644 static/img/php.svg
create mode 100644 static/img/python.svg
create mode 100644 static/img/r.svg
create mode 100644 static/img/ruby.svg
create mode 100644 static/img/rust.svg
create mode 100644 static/img/scala.svg
create mode 100644 static/img/swift.svg
diff --git a/data/js-graphql-clients.json b/data/js-graphql-clients.json
new file mode 100644
index 0000000000..8229754fcf
--- /dev/null
+++ b/data/js-graphql-clients.json
@@ -0,0 +1,72 @@
+[
+ {
+ "name": "Relay",
+ "description": "Facebook's framework for building React applications that talk to a GraphQL backend.",
+ "url": "https://facebook.github.io/relay/",
+ "npm": "react-relay",
+ "github": "facebook/relay"
+ },
+ {
+ "name": "Apollo Client",
+ "description": "A powerful JavaScript GraphQL client, designed to work well with React, React Native, Angular 2, or just plain JavaScript.",
+ "url": "http://apollographql.com/client/",
+ "npm": "@apollo/client",
+ "github": "apollographql/apollo-client"
+ },
+ {
+ "name": "GraphQL Request",
+ "description": "A simple and flexible JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native) - basically a lightweight wrapper around `fetch`.",
+ "url": "https://github.com/prisma/graphql-request",
+ "npm": "graphql-request",
+ "github": "prisma-labs/graphql-request"
+ },
+ {
+ "name": "Lokka",
+ "description": "A simple JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native).",
+ "url": "https://github.com/kadirahq/lokka",
+ "npm": "lokka",
+ "github": "kadirahq/lokka"
+ },
+ {
+ "name": "nanogql",
+ "description": "Tiny GraphQL client library using template strings.",
+ "url": "https://github.com/yoshuawuyts/nanogql",
+ "npm": "nanographql",
+ "github": "yoshuawuyts/nanographql"
+ },
+ {
+ "name": "gq-loader",
+ "description": "A simple JavaScript GraphQL client,Let the *.gql file be used as a module through webpack loader.",
+ "url": "https://github.com/Houfeng/gq-loader",
+ "npm": "gq-loader",
+ "github": "Houfeng/gq-loader"
+ },
+ {
+ "name": "AWS Amplify",
+ "description": "A JavaScript library for application development using cloud services, which supports GraphQL backend and React components for working with GraphQL data.",
+ "url": "https://docs.amplify.aws/",
+ "npm": "aws-amplify",
+ "github": "aws-amplify/amplify-js"
+ },
+ {
+ "name": "Grafoo",
+ "description": "An all purpose GraphQL client with view layer integrations for multiple frameworks in just 1.6kb.",
+ "url": "https://github.com/grafoojs/grafoo",
+ "npm": "@grafoo/core",
+ "github": "grafoojs/grafoo"
+ },
+ {
+ "name": "urql",
+ "description": "A highly customizable and versatile GraphQL client for React.",
+ "url": "https://formidable.com/open-source/urql/",
+ "npm": "urql",
+ "github": "FormidableLabs/urql"
+ },
+ {
+ "name": "graphqurl",
+ "description": "curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.",
+ "url": "https://github.com/hasura/graphqurl",
+ "npm": "graphqurl",
+ "github": "hasura/graphqurl"
+ }
+]
\ No newline at end of file
diff --git a/data/js-server-libraries.json b/data/js-server-libraries.json
new file mode 100644
index 0000000000..848ab3623a
--- /dev/null
+++ b/data/js-server-libraries.json
@@ -0,0 +1,26 @@
+[
+ {
+ "name": "GraphQL.js",
+ "description": "The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.",
+ "howto": "To run a `GraphQL.js` hello world script from the command line:\n\n```bash\nnpm install graphql\n```\n\nThen run `node hello.js` with this code in `hello.js`:\n\n```js\nvar { graphql, buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\ngraphql(schema, '{ hello }', root).then((response) => {\n console.log(response);\n});\n```",
+ "url": "/graphql-js/",
+ "npm": "graphql",
+ "github": "graphql/graphql-js"
+ },
+ {
+ "name": "Express GraphQL",
+ "description": "The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.",
+ "howto": "To run an `express-graphql` hello world server:\n\n```bash\nnpm install express express-graphql graphql\n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nvar express = require('express');\nvar { graphqlHTTP } = require('express-graphql');\nvar { buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\nvar app = express();\napp.use('/graphql', graphqlHTTP({\n schema: schema,\n rootValue: root,\n graphiql: true,\n}));\napp.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));\n```",
+ "url": "/graphql-js/running-an-express-graphql-server/",
+ "npm": "express-graphql",
+ "github": "graphql/express-graphql"
+ },
+ {
+ "name": "Apollo Server",
+ "description": "A set of GraphQL server packages from Apollo that work with various Node.js HTTP frameworks (Express, Connect, Hapi, Koa etc).",
+ "howto": "To run a hello world server with apollo-server-express:\n\n```bash\nnpm install apollo-server-express express \n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nconst express = require('express');\nconst { ApolloServer, gql } = require('apollo-server-express');\n\nconst typeDefs = gql`\n type Query {\n hello: String\n }\n`;\n\nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n\nconst server = new ApolloServer({ typeDefs, resolvers });\n\nconst app = express();\nserver.applyMiddleware({ app });\n\napp.listen({ port: 4000 }, () =>\n console.log('Now browse to http://localhost:4000' + server.graphqlPath)\n);\n```\n\nApollo Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI, Koa and NestJs.",
+ "url": "https://www.apollographql.com/docs/apollo-server/",
+ "npm": "apollo-server-express",
+ "github": "apollographql/apollo-server"
+ }
+]
\ No newline at end of file
diff --git a/data/tools.json b/data/tools.json
new file mode 100644
index 0000000000..f60b6ac77a
--- /dev/null
+++ b/data/tools.json
@@ -0,0 +1,99 @@
+[
+ {
+ "name": "GraphiQL",
+ "description": "An interactive in-browser GraphQL IDE.",
+ "url": "https://github.com/graphql/graphiql",
+ "npm": "graphiql",
+ "github": "graphql/graphiql"
+ },
+ {
+ "name": "libgraphqlparser",
+ "description": "A GraphQL query language parser in C++ with C and C++ APIs.",
+ "url": "https://github.com/graphql/libgraphqlparser",
+ "github": "graphql/libgraphqlparser"
+ },
+ {
+ "name": "GraphQL Language Service",
+ "description": "An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).",
+ "url": "https://github.com/graphql/graphql-language-service",
+ "npm": "graphql-language-service",
+ "github": "graphql/graphql-language-service"
+ },
+ {
+ "name": "quicktype",
+ "description": "Generate types for GraphQL queries in TypeScript, Swift, golang, C#, C++, and more.",
+ "url": "https://quicktype.io/",
+ "npm": "quicktype",
+ "github": "quicktype/quicktype"
+ },
+ {
+ "name": "GraphQL-ESLint",
+ "description": "GraphQL-ESLint integrates GraphQL AST in the ESLint core (as a parser).",
+ "url": "https://github.com/dotansimha/graphql-eslint/",
+ "npm": "@graphql-eslint/eslint-plugin",
+ "github": "dotansimha/graphql-eslint/"
+ },
+ {
+ "name": "GraphQL Modules",
+ "description": "GraphQL Modules lets you separate your backend implementation to small, reusable, easy-to-implement and easy-to-test pieces.",
+ "url": "https://graphql-modules.com",
+ "npm": "graphql-modules",
+ "github": "Urigo/graphql-modules"
+ },
+ {
+ "name": "GraphQL Tools",
+ "description": "A set of utils for faster development of GraphQL tools (Schema and documents loading, Schema merging and more).",
+ "url": "https://graphql-tools.com",
+ "npm": "graphql-tools",
+ "github": "ardatan/graphql-tools"
+ },
+ {
+ "name": "GraphQL Config",
+ "description": "One configuration for all your GraphQL tools (supported by most tools, editors & IDEs).",
+ "url": "https://graphql-config.com",
+ "npm": "graphql-config",
+ "github": "kamilkisiela/graphql-config"
+ },
+ {
+ "name": "GraphQL Mesh",
+ "description": "GraphQL Mesh allows you to use GraphQL query language to access data in remote APIs that don't run GraphQL (and also ones that do run GraphQL). It can be used as a gateway to other services, or run as a local GraphQL schema that aggregates data from remote APIs.",
+ "url": "https://graphql-mesh.com",
+ "npm": "@graphql-mesh/cli",
+ "github": "Urigo/graphql-mesh"
+ },
+ {
+ "name": "GraphQL Code Generator",
+ "description": "GraphQL code generator with flexible support for custom plugins and templates like Typescript (frontend and backend), React Hooks, resolvers signatures and more.",
+ "url": "https://graphql-code-generator.com",
+ "npm": "@graphql-codegen/cli",
+ "github": "dotansimha/graphql-code-generator"
+ },
+ {
+ "name": "GraphQL CLI",
+ "description": "A command line tool for common GraphQL development workflows.",
+ "url": "https://graphql-cli.com",
+ "npm": "graphql-cli",
+ "github": "Urigo/graphql-cli"
+ },
+ {
+ "name": "GraphQL Inspector",
+ "description": "Compare schemas, validate documents, find breaking changes, find similar types, schema coverage, and more.",
+ "url": "https://graphql-inspector.com/",
+ "npm": "@graphql-inspector/cli",
+ "github": "kamilkisiela/graphql-inspector"
+ },
+ {
+ "name": "GraphQL Scalars",
+ "description": "A library of custom GraphQL scalar types for creating precise, type-safe GraphQL schemas.",
+ "url": "https://github.com/Urigo/graphql-scalars",
+ "npm": "graphql-scalars",
+ "github": "Urigo/graphql-scalars"
+ },
+ {
+ "name": "SOFA",
+ "description": "Generate REST API from your GraphQL API.",
+ "url": "https://sofa-api.com/",
+ "npm": "sofa-api",
+ "github": "Urigo/SOFA"
+ }
+]
\ No newline at end of file
diff --git a/gatsby-node.js b/gatsby-node.js
index 1f01018018..82b904ee78 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -1,14 +1,35 @@
const path = require("path")
+const { readFileSync } = require("fs")
+const sortLibs = require("./scripts/sort-libraries")
exports.onCreatePage = async ({ page, actions }) => {
const { createPage, deletePage } = actions
deletePage(page)
+ let context = {
+ ...page.context,
+ sourcePath: path.relative(__dirname, page.componentPath),
+ }
+ if (page.path === "/code" || page.path === "/code/") {
+ const [jsGraphQLClients, jsServerLibraries, tools] = await Promise.all([
+ sortLibs(
+ JSON.parse(readFileSync("./data/js-graphql-clients.json", "utf8"))
+ ),
+ sortLibs(
+ JSON.parse(readFileSync("./data/js-server-libraries.json", "utf8"))
+ ),
+ sortLibs(JSON.parse(readFileSync("./data/tools.json", "utf8"))),
+ ])
+
+ context = {
+ ...context,
+ jsGraphQLClients,
+ jsServerLibraries,
+ tools,
+ }
+ }
createPage({
...page,
- context: {
- ...page.context,
- sourcePath: path.relative(__dirname, page.componentPath),
- },
+ context,
})
}
diff --git a/scripts/sort-libraries.js b/scripts/sort-libraries.js
new file mode 100644
index 0000000000..ef187c2cc8
--- /dev/null
+++ b/scripts/sort-libraries.js
@@ -0,0 +1,144 @@
+const fetch = require(`node-fetch`)
+
+const getGitHubStats = async githubRepo => {
+ const [owner, repoName] = githubRepo.split("/")
+ const accessToken = process.env.GITHUB_ACCESS_TOKEN;
+ if (!accessToken) {
+ throw new Error(`You must have GITHUB_ACCESS_TOKEN env variable defined!`);
+ }
+ const query = /* GraphQL */ `
+ fragment defaultBranchRef on Ref {
+ target {
+ ... on Commit {
+ history(since: $since) {
+ edges {
+ node {
+ author {
+ name
+ }
+ pushedDate
+ }
+ }
+ }
+ }
+ }
+ }
+ query($owner: String!, $repoName: String!, $since: GitTimestamp!) {
+ repositoryOwner(login: $owner) {
+ repository(name: $repoName) {
+ mainRef: ref(qualifiedName: "main") {
+ ...defaultBranchRef
+ }
+ sourceRef: ref(qualifiedName: "source") {
+ ...defaultBranchRef
+ }
+ masterRef: ref(qualifiedName: "master") {
+ ...defaultBranchRef
+ }
+ stargazers {
+ totalCount
+ }
+ updatedAt
+ forkCount
+ pullRequests {
+ totalCount
+ }
+ description
+ }
+ }
+ }
+ `
+ const lastMonth = new Date();
+ lastMonth.setMonth(lastMonth.getMonth() - 1);
+ const response = await fetch("https://api.github.com/graphql", {
+ method: "POST",
+ body: JSON.stringify({
+ query,
+ variables: { owner, repoName, since: lastMonth },
+ }),
+ headers: {
+ Authorization: `Bearer ${accessToken}`,
+ "Content-Type": "application/json",
+ },
+ })
+ const responseJson = await response.json()
+ const repo = responseJson.data.repositoryOwner.repository
+ const stars = repo.stargazers.totalCount
+ const commitHistory = (repo.mainRef || repo.sourceRef || repo.masterRef)
+ .target.history.edges
+ let commitCount = 0, daysWithCommitSet = new Set(), finalUpdatedTime;
+ commitHistory.forEach(commit => {
+ if (!commit.node.author.name.match(/bot/i)) {
+ commitCount++
+ daysWithCommitSet.add(new Date(commit.node.pushedDate).getDate())
+ }
+ })
+ return {
+ commitCount,
+ daysWithCommit: daysWithCommitSet.size,
+ stars,
+ }
+}
+
+const getNpmStats = async packageName => {
+ const response = await fetch(
+ `https://api.npmjs.org/downloads/point/last-week/${encodeURIComponent(
+ packageName
+ )}`
+ )
+ const responseJson = await response.json()
+ const downloadCount = responseJson.downloads
+ return { downloadCount }
+}
+
+const sortLibs = async libs => {
+ const libsWithScores = await Promise.all(
+ libs.map(async lib => {
+ const [npmStats = {}, githubStats = {}] = await Promise.all([
+ lib.npm && getNpmStats(lib.npm),
+ lib.github && getGitHubStats(lib.github),
+ ])
+ return {
+ ...lib,
+ ...npmStats,
+ ...githubStats,
+ }
+ })
+ )
+ return libsWithScores.sort((a, b) => {
+ let aScore = 0,
+ bScore = 0
+ if (a.npm && b.npm) {
+ if (a.downloadCount > b.downloadCount) {
+ aScore += 40;
+ } else if (b.downloadCount > a.downloadCount) {
+ bScore += 40;
+ }
+ }
+ if (a.github && b.github) {
+ if (a.daysWithCommit > b.daysWithCommit) {
+ aScore += 20
+ } else if (a.daysWithCommit < b.daysWithCommit) {
+ bScore += 20
+ }
+ if (a.commitCount > b.commitCount) {
+ aScore += 20;
+ } else if (a.commitCount < b.commitCount) {
+ bScore += 20;
+ }
+ if (a.stars > b.stars) {
+ aScore += 30;
+ } else if (a.stars < b.stars) {
+ bScore += 30;
+ }
+ }
+ if (bScore > aScore) {
+ return 1
+ } else if (bScore < aScore) {
+ return -1
+ }
+ return 0
+ })
+}
+
+module.exports = sortLibs
diff --git a/src/content/code/code.md b/src/pages/code.tsx
similarity index 55%
rename from src/content/code/code.md
rename to src/pages/code.tsx
index 29e381a0f9..9ad5447d36 100644
--- a/src/content/code/code.md
+++ b/src/pages/code.tsx
@@ -1,42 +1,365 @@
----
-title: Code
-layout: code
-permalink: /code/
----
-
-Many different programming languages support GraphQL. This list contains some of the more popular server-side frameworks, client libraries, services, and other useful stuff.
-
-## Server Libraries
-
-In addition to the GraphQL [reference implementations in JavaScript](#javascript), server libraries include:
-
-- [C# / .NET](#c-net)
-- [Clojure](#clojure)
-- [D](#d)
-- [Elixir](#elixir)
-- [Erlang](#erlang)
-- [Go](#go)
-- [Groovy](#groovy)
-- [Haskell](#haskell)
-- [Java](#java)
-- [JavaScript](#javascript)
-- [Julia](#julia)
-- [Kotlin](#kotlin)
-- [Perl](#perl)
-- [PHP](#php)
-- [Python](#python)
-- [R](#r)
-- [Ruby](#ruby)
-- [Rust](#rust)
-- [Scala](#scala)
-- [Swift](#swift)
-- [OCaml / Reason](#ocaml-reason)
-
-### C# / .NET
-
+import React from "react"
+import Layout from "../components/Layout"
+import Marked from "../components/Marked"
+
+export default ({ pageContext }) => {
+ return (
+
+
+
+
Code
+
using GraphQL
+
+
+
+
+
+
+
+ Because GraphQL is a communication pattern, there are many tools
+ to help you get started working which support GraphQL in all
+ sorts of languages.
+ {" "}
+
+
+ {`
+## C# / .NET
+### Server Libraries
#### [graphql-dotnet](https://github.com/graphql-dotnet/graphql-dotnet): GraphQL for .NET
-
-```csharp
+\`\`\`csharp
using System;
using GraphQL;
using GraphQL.Types;
@@ -59,22 +382,24 @@ public class Program
Console.WriteLine(json);
}
-}
-```
-
+}
+\`\`\`
- [graphql-net](https://github.com/ckimes89/graphql-net): Convert GraphQL to IQueryable
- [Entity GraphQL](https://github.com/lukemurray/EntityGraphQL): .NET Core GraphQL library. Compiles to IQueryable to easily expose a schema from an existing data model (E.g. from an Entity Framework data model)
- [DotNetGraphQLQueryGen](https://github.com/lukemurray/DotNetGraphQLQueryGen): .NET Core library to generate classes from a GraphQL schema for type-safe querying in dotnet
- [Hot Chocolate](https://github.com/ChilliCream/hotchocolate): GraphQL Server for .NET core and .NET classic
- [NGraphQL](https://github.com/rivantsov/starwars): GraphQL Server for .NET Core and full framework
-
-### Clojure
-#### [alumbra](https://github.com/alumbra/alumbra)
+### GraphQL Clients
+ - [GraphQL.Client](https://github.com/graphql-dotnet/graphql-client): A GraphQL Client for .NET.
+ - [graphql-net-client](https://github.com/bkniffler/graphql-net-client): Basic example GraphQL client for .NET.
+ - [SAHB.GraphQLClient](https://github.com/sahb1239/SAHB.GraphQLClient): GraphQL client which supports generating queries from C# classes
+## Clojure
+### Server Libraries
+#### [alumbra](https://github.com/alumbra/alumbra)
A set of reusable GraphQL components for Clojure conforming to the data structures given in [alumbra.spec](https://github.com/alumbra/alumbra.spec).
-
-```clojure
+\`\`\`clojure
(require '[alumbra.core :as alumbra]
'[claro.data :as data])
@@ -100,22 +425,19 @@ A set of reusable GraphQL components for Clojure conforming to the data structur
(defonce my-graphql-server
(aleph.http/start-server #'app {:port 3000}))
-```
+\`\`\`
-```bash
+\`\`\`bash
$ curl -XPOST "http://0:3000" -H'Content-Type: application/json' -d'{
"query": "{ me { name, friends { name } } }"
}'
{"data":{"me":{"name":"Person #0","friends":[{"name":"Person #1"},{"name":"Person #2"}]}}}
-```
+\`\`\`
#### [graphql-clj](https://github.com/tendant/graphql-clj)
-
A Clojure library that provides a GraphQL implementation.
-
-Code that executes a hello world GraphQL query with `graphql-clj`:
-
-```clojure
+Code that executes a hello world GraphQL query with \`graphql-clj\`:
+\`\`\`clojure
(def schema "type QueryRoot {
hello: String
@@ -129,52 +451,59 @@ Code that executes a hello world GraphQL query with `graphql-clj`:
(require '[graphql-clj.executor :as executor])
(executor/execute nil schema resolver-fn "{ hello }")
-```
-
+\`\`\`
#### [lacinia](https://github.com/walmartlabs/lacinia)
-
A full implementation of the GraphQL specification that aims to maintain external compliance with the specification.
+### GraphQL Clients
+ - [re-graph](https://github.com/oliyh/re-graph/): A GraphQL client implemented in Clojurescript with support for websockets.
+
### D
- [graphqld](https://github.com/burner/graphqld): A GraphQL implementaiton for the D Programming Language.
### Elixir
-
+### Server Libraries
- [absinthe](https://github.com/absinthe-graphql/absinthe): GraphQL implementation for Elixir.
- [graphql-elixir](https://github.com/graphql-elixir/graphql): An Elixir implementation of Facebook's GraphQL.
-### Erlang
+## Elm
+### GraphQL Clients
+ - [dillonkearns/elm-graphql](https://github.com/dillonkearns/elm-graphql): Library and command-line code generator to create type-safe Elm code for a GraphQL endpoint.
+## Erlang
+### Server Libraries
- [graphql-erlang](https://github.com/shopgun/graphql-erlang): GraphQL implementation in Erlang.
-### Go
+## Flutter
+### GraphQL Clients
+ - [graphql](https://github.com/zino-app/graphql-flutter#readme): A GraphQL client implementation in Flutter.
+## Go
+### Server Libraries
- [graphql-go](https://github.com/graphql-go/graphql): An implementation of GraphQL for Go / Golang.
- [graph-gophers/graphql-go](https://github.com/graph-gophers/graphql-go): An active implementation of GraphQL in Golang (was https://github.com/neelance/graphql-go).
- [99designs/gqlgen](https://github.com/99designs/gqlgen) - Go generate based graphql server library.
- [graphql-relay-go](https://github.com/graphql-go/relay): A Go/Golang library to help construct a graphql-go server supporting react-relay.
+ - [machinebox/graphql](https://github.com/machinebox/graphql): An elegant low-level HTTP client for GraphQL.
- [samsarahq/thunder](https://github.com/samsarahq/thunder): A GraphQL implementation with easy schema building, live queries, and batching.
- [appointy/jaal](https://github.com/appointy/jaal): Develop spec compliant GraphQL servers in Go.
-### Groovy
+### GraphQL Clients
+ - [graphql](https://github.com/shurcooL/graphql#readme): A GraphQL client implementation in Go.
+## Groovy
+### Server Libraries
#### [gorm-graphql](https://github.com/grails/gorm-graphql/)
-
**Core Library** - The GORM GraphQL library provides functionality to generate a GraphQL schema based on your GORM entities. In addition to mapping domain classes to a GraphQL schema, the core library also provides default implementations of "data fetchers" to query, update, and delete data through executions of the schema.
-
**Grails Plugin** - In a addition to the Core Library, the GORM GraphQL Grails Plugin:
-
- Provides a controller to receive and respond to GraphQL requests through HTTP, based on their guidelines.
- Generates the schema at startup with spring bean configuration to make it easy to extend.
- Includes a [GraphiQL](https://github.com/graphql/graphiql) browser enabled by default in development. The browser is accessible at /graphql/browser.
- Overrides the default data binder to use the data binding provided by Grails
- Provides a [trait](https://grails.github.io/gorm-graphql/latest/api/org/grails/gorm/graphql/plugin/testing/GraphQLSpec.html) to make integration testing of your GraphQL endpoints easier
-
See [the documentation](https://grails.github.io/gorm-graphql/latest/guide/index.html) for more information.
-
#### [GQL](https://grooviter.github.io/gql/)
-
GQL is a Groovy library for GraphQL
### Haskell
@@ -244,16 +573,13 @@ api = interpreter rootResolver
See [morpheus-graphql-examples](https://github.com/morpheusgraphql/morpheus-graphql) for more sophisticated APIs.
-
-### Java
-
+## Java / Android
+### Server Libraries
#### [graphql-java](https://github.com/graphql-java/graphql-java)
-
A Java library for building GraphQL APIs.
+Code that executes a hello world GraphQL query with \`graphql-java\`:
-Code that executes a hello world GraphQL query with `graphql-java`:
-
-```java
+\`\`\`java
import graphql.ExecutionResult;
import graphql.GraphQL;
import graphql.schema.GraphQLSchema;
@@ -287,129 +613,53 @@ public class HelloWorld {
// Prints: {hello=world}
}
}
-```
+\`\`\`
See [the graphql-java docs](https://github.com/graphql-java/graphql-java) for more information on setup.
-### JavaScript
-
-#### [GraphQL.js](/graphql-js/) ([github](https://github.com/graphql/graphql-js/)) ([npm](https://www.npmjs.com/package/graphql))
-
-The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.
-
-To run a `GraphQL.js` hello world script from the command line:
-
-```bash
-npm install graphql
-```
-
-Then run `node hello.js` with this code in `hello.js`:
-
-```js
-var { graphql, buildSchema } = require('graphql');
-
-var schema = buildSchema(`
- type Query {
- hello: String
- }
-`);
-
-var root = { hello: () => 'Hello world!' };
-
-graphql(schema, '{ hello }', root).then((response) => {
- console.log(response);
-});
-```
-
-#### [express-graphql](/graphql-js/running-an-express-graphql-server/) ([github](https://github.com/graphql/express-graphql)) ([npm](https://www.npmjs.com/package/express-graphql))
-
-The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.
-
-To run an `express-graphql` hello world server:
-
-```bash
-npm install express express-graphql graphql
-```
-
-Then run `node server.js` with this code in `server.js`:
-
-```js
-var express = require('express');
-var { graphqlHTTP } = require('express-graphql');
-var { buildSchema } = require('graphql');
-
-var schema = buildSchema(`
- type Query {
- hello: String
- }
-`);
-
-var root = { hello: () => 'Hello world!' };
-
-var app = express();
-app.use('/graphql', graphqlHTTP({
- schema: schema,
- rootValue: root,
- graphiql: true,
-}));
-app.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));
-```
-
-#### [apollo-server](https://www.apollographql.com/docs/apollo-server/) ([github](https://github.com/apollographql/apollo-server)) ([npm](https://www.npmjs.com/package/apollo-server-express))
-
-A set of GraphQL server packages from Apollo that work with various Node.js HTTP frameworks (Express, Connect, Hapi, Koa etc).
-
-To run a hello world server with apollo-server-express:
-
-```bash
-npm install apollo-server-express express
-```
-
-Then run `node server.js` with this code in `server.js`:
-
-```js
-const express = require('express');
-const { ApolloServer, gql } = require('apollo-server-express');
-
-const typeDefs = gql`
- type Query {
- hello: String
- }
-`;
-
-const resolvers = {
- Query: {
- hello: () => 'Hello world!',
- },
-};
-
-const server = new ApolloServer({ typeDefs, resolvers });
-
-const app = express();
-server.applyMiddleware({ app });
-
-app.listen({ port: 4000 }, () =>
- console.log('Now browse to http://localhost:4000' + server.graphqlPath)
-);
-```
-
-Apollo Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI, Koa and NestJs.
+### GraphQL Clients
+ - [Apollo Android](https://github.com/apollographql/apollo-android): A strongly-typed, caching GraphQL client for Android, written in Java.
+ - [Nodes](https://github.com/americanexpress/nodes): A GraphQL JVM Client designed for constructing queries from standard model definitions. By American Express.
-### Kotlin
+## JavaScript
+### Server Libraries
+${pageContext.jsServerLibraries
+ .map(
+ (
+ library: any
+ ) => `#### [${library.name}](${library.url}) ([github](https://github.com/${library.github})) ([npm](https://www.npmjs.com/package/${library.npm}))
+${library.description}
+${library.howto}`
+ )
+ .join("\n")}
+
+### GraphQL Clients
+${pageContext.jsGraphQLClients
+ .map(
+ (library: any) =>
+ `- [${library.name}](${library.url}) ([github](https://github.com/${library.github})) ([npm](https://www.npmjs.com/package/${library.npm})): ${library.description}`
+ )
+ .join("\n")}
+
+## Julia
+### GraphQL Clients
+ - [Diana.jl](https://github.com/codeneomatrix/Diana.jl): A Julia GraphQL server implementation.
+## Kotlin
+### Server Libraries
- [graphql-kotlin](https://github.com/ExpediaGroup/graphql-kotlin/): A set of libraries for running GraphQL server in Kotlin.
- [KGraphQL](https://github.com/aPureBase/KGraphQL): Pure Kotlin implementation to setup a GraphQL server.
-### Perl
-
+## Perl
+### Server Libraries
- [graphql-perl](https://github.com/graphql-perl/graphql-perl): A Perl port of GraphQL reference implementation
- [MetaCPAN documentation](https://metacpan.org/pod/GraphQL)
- [Mojolicious-Plugin-GraphQL](https://github.com/graphql-perl/Mojolicious-Plugin-GraphQL) - connect your GraphQL service to a Mojolicious app
- [GraphQL-Plugin-Convert-DBIC](https://github.com/graphql-perl/GraphQL-Plugin-Convert-DBIC) - automatically connect your DBIx::Class schema to GraphQL
- [GraphQL-Plugin-Convert-OpenAPI](https://github.com/graphql-perl/GraphQL-Plugin-Convert-OpenAPI) - automatically connect any OpenAPI service (either local Mojolicious one, or remote) to GraphQL
-### PHP
-
+## PHP
+### Server Libraries
- [graphql-php](https://github.com/webonyx/graphql-php): A PHP port of GraphQL reference implementation
- [graphql-relay-php](https://github.com/ivome/graphql-relay-php): A library to help construct a graphql-php server supporting react-relay.
- [Railt](https://github.com/railt/railt): A PHP GraphQL Framework.
@@ -420,11 +670,10 @@ Apollo Server also supports all Node.js HTTP server frameworks: Express, Connect
- [GraPHPinator](https://github.com/infinityloop-dev/graphpinator): A GraphQL implementation for modern PHP
#### [API Platform](https://api-platform.com) ([github](https://github.com/api-platform/api-platform))
-
API Platform is a fully-featured, flexible and extensible API framework built on top of Symfony.
The following class is enough to create both a Relay-compatible GraphQL server and a hypermedia API supporting modern REST formats (JSON-LD, JSONAPI...):
-```php
+\`\`\`php
$err->getMessage(),
]);
})()->run();
-```
-
+\`\`\`
It also provides functionality for the construction of a WebSocket Subscriptions Server based on how Apollo works.
-### Swift
-
- - [Graphiti](https://github.com/GraphQLSwift/Graphiti): Swift library for building GraphQL schemas/types fast, safely and easily.
-
-### Python
-
+## Python
+### Server Libraries
#### [Graphene](http://graphene-python.org/) ([github](https://github.com/graphql-python/graphene))
-
A Python library for building GraphQL APIs.
-
To run a Graphene hello world script:
-```bash
+\`\`\`bash
pip install graphene
-```
+\`\`\`
-Then run `python hello.py` with this code in `hello.py`:
+Then run \`python hello.py\` with this code in \`hello.py\`:
-```python
+\`\`\`python
import graphene
class Query(graphene.ObjectType):
@@ -566,25 +798,31 @@ class Query(graphene.ObjectType):
schema = graphene.Schema(query=Query)
result = schema.execute('{ hello }')
print(result.data['hello']) # "Hello World"
-```
+\`\`\`
There are also nice bindings for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine.
+### GraphQL Clients
+ - [GQL](https://github.com/graphql-python/gql): A GraphQL client in Python.
+ - [python-graphql-client](https://github.com/prisma/python-graphql-client): Simple GraphQL client for Python 2.7+.
+ - [sgqlc](https://github.com/profusion/sgqlc): A simple Python GraphQL client. Supports generating code generation for types defined in a GraphQL schema.
-### Ruby
-#### [graphql-ruby](https://github.com/rmosolgo/graphql-ruby)
+## R
+### GraphQL Clients
+ - [ghql](https://github.com/ropensci/ghql): General purpose GraphQL R client.
+## Ruby
+### Server Libraries
+#### [graphql-ruby](https://github.com/rmosolgo/graphql-ruby)
A Ruby library for building GraphQL APIs.
-
-To run a hello world script with `graphql-ruby`:
-
-```bash
+To run a hello world script with \`graphql-ruby\`:
+\`\`\`bash
gem install graphql
-```
+\`\`\`
-Then run `ruby hello.rb` with this code in `hello.rb`:
+Then run \`ruby hello.rb\` with this code in \`hello.rb\`:
-```ruby
+\`\`\`ruby
require 'graphql'
class QueryType < GraphQL::Schema::Object
@@ -600,15 +838,11 @@ class Schema < GraphQL::Schema
end
puts Schema.execute('{ hello }').to_json
-```
-
+\`\`\`
There are also nice bindings for Relay and Rails.
-
#### [Agoo](https://github.com/ohler55/agoo)
-
A high performance web server with support for GraphQL. Agoo strives for a simple, easy to use API for GraphQL.
-
-```ruby
+\`\`\`ruby
require 'agoo'
class Query
@@ -636,19 +870,17 @@ sleep
# a URL of localhost:6464/graphql?query={hello}
#
# ruby hello.rb
-```
-
-### Rust
+\`\`\`
+## Rust
+### Server Libraries
- [graphql-rust/juniper](https://github.com/graphql-rust/juniper): GraphQL server library for Rust
-### Scala
-
+## Scala
+### Server Libraries
#### [Sangria](http://sangria-graphql.org/) ([github](https://github.com/sangria-graphql/sangria)): A Scala GraphQL library that supports [Relay](https://facebook.github.io/relay/).
-
-An example of a hello world GraphQL schema and query with `sangria`:
-
-```scala
+An example of a hello world GraphQL schema and query with \`sangria\`:
+\`\`\`scala
import sangria.schema._
import sangria.execution._
import sangria.macros._
@@ -662,123 +894,30 @@ val schema = Schema(QueryType)
val query = graphql"{ hello }"
Executor.execute(schema, query) map println
-```
-
-### OCaml / Reason
+\`\`\`
+## OCaml / Reason
+### Server Libraries
#### [ocaml-graphql-server](https://github.com/andreas/ocaml-graphql-server): GraphQL server library for OCaml and Reason
-## GraphQL Clients
-
-- [C# / .NET](#c-net-1)
-- [Clojurescript](#clojurescript-1)
-- [Elixir](#elixir-1)
-- [Elm](#elm)
-- [Flutter](#flutter)
-- [Go](#go-1)
-- [Haskell](#haskell)
-- [Java / Android](#java-android)
-- [JavaScript](#javascript-1)
-- [Julia](#julia)
-- [Kotlin](#kotlin)
-- [Swift / Objective-C iOS](#swift-objective-c-ios)
-- [Python](#python-1)
-- [R](#r)
-
-### C# / .NET
-
- - [GraphQL.Client](https://github.com/graphql-dotnet/graphql-client): A GraphQL Client for .NET.
- - [graphql-net-client](https://github.com/bkniffler/graphql-net-client): Basic example GraphQL client for .NET.
- - [SAHB.GraphQLClient](https://github.com/sahb1239/SAHB.GraphQLClient): GraphQL client which supports generating queries from C# classes
-
-### Clojurescript
-
- - [re-graph](https://github.com/oliyh/re-graph/): A GraphQL client implemented in Clojurescript with support for websockets.
-
-### Elixir
-
- - [Neuron](https://github.com/uesteibar/neuron): A GraphQL client for Elixir
- - [common_graphql_client](https://github.com/annkissam/common_graphql_client): Elixir GraphQL Client with HTTP and WebSocket support
-
-### Elm
+## Swift / Objective-C iOS
+### Server Libraries
+ - [Graphiti](https://github.com/GraphQLSwift/Graphiti): Swift library for building GraphQL schemas/types fast, safely and easily.
- - [dillonkearns/elm-graphql](https://github.com/dillonkearns/elm-graphql): Library and command-line code generator to create type-safe Elm code for a GraphQL endpoint.
-
-### Flutter
-
- - [graphql](https://github.com/zino-app/graphql-flutter#readme): A GraphQL client implementation in Flutter.
-
-### Go
-
- - [graphql](https://github.com/shurcooL/graphql#readme): A GraphQL client implementation in Go.
- - [machinebox/graphql](https://github.com/machinebox/graphql): An elegant low-level HTTP client for GraphQL.
-
-### Haskell
-
- - [morpheus-graphql-client](https://github.com/morpheusgraphql/morpheus-graphql): A strongly-typed GraphQL client implementation in Haksell.
-
-### Java / Android
-
- - [Apollo Android](https://github.com/apollographql/apollo-android): A strongly-typed, caching GraphQL client for the JVM, Android and Kotlin native.
-
- - [Nodes](https://github.com/americanexpress/nodes): A GraphQL JVM Client designed for constructing queries from standard model definitions. By American Express.
-
-### JavaScript
-
- - [Relay](https://facebook.github.io/relay/) ([github](https://github.com/facebook/relay)) ([npm](https://www.npmjs.com/package/react-relay)): Facebook's framework for building React applications that talk to a GraphQL backend.
- - [Apollo Client](http://apollographql.com/client/) ([github](https://github.com/apollographql/apollo-client)): A powerful JavaScript GraphQL client, designed to work well with React, React Native, Angular 2, or just plain JavaScript.
- - [graphql-request](https://github.com/prisma/graphql-request): A simple and flexible JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native) - basically a lightweight wrapper around `fetch`.
- - [Lokka](https://github.com/kadirahq/lokka): A simple JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native).
- - [nanogql](https://github.com/yoshuawuyts/nanogql): Tiny GraphQL client library using template strings.
- - [gq-loader](https://github.com/Houfeng/gq-loader): A simple JavaScript GraphQL client,Let the *.gql file be used as a module through webpack loader.
- - [AWS Amplify](https://aws.github.io/aws-amplify): A JavaScript library for application development using cloud services, which supports GraphQL backend and React components for working with GraphQL data.
- - [Grafoo](https://github.com/grafoojs/grafoo): An all purpose GraphQL client with view layer integrations for multiple frameworks in just 1.6kb.
- - [urql](https://formidable.com/open-source/urql/) ([github](https://github.com/FormidableLabs/urql)): A highly customizable and versatile GraphQL client for React.
- - [graphqurl](https://github.com/hasura/graphqurl) ([npm](https://www.npmjs.com/package/graphqurl)): curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.
-
-### Julia
-
- - [Diana.jl](https://github.com/codeneomatrix/Diana.jl): A Julia GraphQL server implementation.
-
-### Kotlin
-
- - [graphql-kotlin](https://github.com/ExpediaGroup/graphql-kotlin/): A set of GraphQL libraries that includes a lightweight, typesafe GraphQL HTTP client.
-
-### Swift / Objective-C iOS
-
+### GraphQL Clients
- [Apollo iOS](https://www.apollographql.com/docs/ios/) ([github](https://github.com/apollographql/apollo-ios)): A GraphQL client for iOS that returns results as query-specific Swift types, and integrates with Xcode to show your Swift source and GraphQL side by side, with inline validation errors.
- [GraphQL iOS](https://github.com/funcompany/graphql-ios): An Objective-C GraphQL client for iOS.
- [Graphaello](https://github.com/nerdsupremacist/Graphaello): A Tool for Writing Declarative, Type-Safe and Data-Driven Applications in SwiftUI using GraphQL and Apollo
-### Python
-
- - [GQL](https://github.com/graphql-python/gql): A GraphQL client in Python.
- - [python-graphql-client](https://github.com/prisma/python-graphql-client): Simple GraphQL client for Python 2.7+.
- - [sgqlc](https://github.com/profusion/sgqlc): A simple Python GraphQL client. Supports generating code generation for types defined in a GraphQL schema.
-
-### R
-
- - [ghql](https://github.com/ropensci/ghql): General purpose GraphQL R client.
-
## Tools
-
- - [graphiql](https://github.com/graphql/graphiql) ([npm](https://www.npmjs.com/package/graphiql)): An interactive in-browser GraphQL IDE.
- - [libgraphqlparser](https://github.com/graphql/libgraphqlparser): A GraphQL query language parser in C++ with C and C++ APIs.
- - [Graphql Language Service](https://github.com/graphql/graphql-language-service): An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).
- - [quicktype](https://quicktype.io) ([github](https://github.com/quicktype/quicktype)): Generate types for GraphQL queries in TypeScript, Swift, golang, C#, C++, and more.
- - [GraphQL Code Generator](https://graphql-code-generator.com): GraphQL code generator with flexible support for custom plugins and templates like Typescript (frontend and backend), React Hooks, resolvers signatures and more.
- - [GraphQL Inspector](https://www.graphql-inspector.com): Compare schemas, validate documents, find breaking changes, find similar types, schema coverage, and more.
- - [GraphQL Config](https://www.graphql-config.com): One configuration for all your GraphQL tools (supported by most tools, editors & IDEs).
- - [GraphQL CLI](https://www.graphql-cli.com): A command line tool for common GraphQL development workflows.
- - [GraphQL Scalars](https://github.com/Urigo/graphql-scalars): A library of custom GraphQL scalar types for creating precise, type-safe GraphQL schemas.
- - [GraphQL Tools](https://www.graphql-tools.com): A set of utils for faster development of GraphQL tools (Schema and documents loading, Schema merging and more).
- - [SOFA](https://github.com/Urigo/sofa): Generate REST API from your GraphQL API.
- - [GraphQL-ESLint](https://github.com/dotansimha/graphql-eslint): integrates GraphQL AST in the ESLint core (as a parser).
- - [GraphQL Modules](https://www.graphql-modules.com): lets you separate your backend implementation to small, reusable, easy-to-implement and easy-to-test pieces.
- - [GraphQL Mesh](https://www.graphql-mesh.com): allows you to use GraphQL query language to access data in remote APIs that don't run GraphQL (and also ones that do run GraphQL). It can be used as a gateway to other services, or run as a local GraphQL schema that aggregates data from remote APIs.
+${pageContext.tools
+ .map(
+ (library: any) =>
+ `- [${library.name}](${library.url}) ([github](https://github.com/${library.github})) ([npm](https://www.npmjs.com/package/${library.npm})): ${library.description}`
+ )
+ .join("\n")}
## Services
-
- [Apollo Graph Manager](https://engine.apollographql.com): A cloud service for monitoring the performance and usage of your GraphQL backend.
- [GraphCMS](https://graphcms.com/): 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.
- [Prisma](https://www.prisma.io) ([github](https://github.com/prisma)): 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.
@@ -787,9 +926,13 @@ Executor.execute(schema, query) map println
- [Elide](https://elide.io): A Java library that can expose a JPA annotated data model as a GraphQL service over any relational database.
- [Hasura](https://hasura.io) ([github](https://github.com/hasura)): Hasura connects to your databases & microservices and instantly gives you a production-ready GraphQL API.
- [FaunaDB](https://docs.fauna.com/fauna/current/graphql): Create an instant GraphQL backend by importing a gql schema. The database will create relations and indexes for you, so you'll be ready to query in seconds, without writing any database code. Serverless pricing, free to get started.
- - [Back4App](https://www.back4app.com/docs/parse-graphql/graphql-getting-started): Back4App is a Backend as a Service Platform that helps you Build and Scale modern applications based on GraphQL.
## More Stuff
-
- [awesome-graphql](https://github.com/chentsulin/awesome-graphql): A fantastic community maintained collection of libraries, resources, and more.
-
+ `}
+
+
+
+
+ )
+}
diff --git a/static/img/clojure.svg b/static/img/clojure.svg
new file mode 100644
index 0000000000..5ab8126b90
--- /dev/null
+++ b/static/img/clojure.svg
@@ -0,0 +1,50 @@
+
+
\ No newline at end of file
diff --git a/static/img/csharp.svg b/static/img/csharp.svg
new file mode 100644
index 0000000000..56f39374dd
--- /dev/null
+++ b/static/img/csharp.svg
@@ -0,0 +1,10 @@
+
+
diff --git a/static/img/elixir.svg b/static/img/elixir.svg
new file mode 100644
index 0000000000..797b0114e8
--- /dev/null
+++ b/static/img/elixir.svg
@@ -0,0 +1 @@
+
diff --git a/static/img/elm.svg b/static/img/elm.svg
new file mode 100644
index 0000000000..ef7f61a9b6
--- /dev/null
+++ b/static/img/elm.svg
@@ -0,0 +1,36 @@
+
diff --git a/static/img/erlang.svg b/static/img/erlang.svg
new file mode 100644
index 0000000000..e8f2bc5dd3
--- /dev/null
+++ b/static/img/erlang.svg
@@ -0,0 +1,61 @@
+
+
diff --git a/static/img/golang.svg b/static/img/golang.svg
new file mode 100644
index 0000000000..ea3c66fca6
--- /dev/null
+++ b/static/img/golang.svg
@@ -0,0 +1 @@
+
diff --git a/static/img/groovy.svg b/static/img/groovy.svg
new file mode 100644
index 0000000000..e4e37042b2
--- /dev/null
+++ b/static/img/groovy.svg
@@ -0,0 +1,449 @@
+
+
+
\ No newline at end of file
diff --git a/static/img/java.svg b/static/img/java.svg
new file mode 100644
index 0000000000..b39f039ca4
--- /dev/null
+++ b/static/img/java.svg
@@ -0,0 +1 @@
+
diff --git a/static/img/julia.svg b/static/img/julia.svg
new file mode 100644
index 0000000000..2abc433fbf
--- /dev/null
+++ b/static/img/julia.svg
@@ -0,0 +1 @@
+
diff --git a/static/img/kotlin.svg b/static/img/kotlin.svg
new file mode 100644
index 0000000000..3480717db7
--- /dev/null
+++ b/static/img/kotlin.svg
@@ -0,0 +1,34 @@
+
+
+
diff --git a/static/img/node.svg b/static/img/node.svg
new file mode 100644
index 0000000000..310150e016
--- /dev/null
+++ b/static/img/node.svg
@@ -0,0 +1 @@
+
diff --git a/static/img/ocaml.svg b/static/img/ocaml.svg
new file mode 100644
index 0000000000..6b1fe9aca6
--- /dev/null
+++ b/static/img/ocaml.svg
@@ -0,0 +1,116 @@
+
+
+
\ No newline at end of file
diff --git a/static/img/perl.svg b/static/img/perl.svg
new file mode 100644
index 0000000000..3b41afb6bc
--- /dev/null
+++ b/static/img/perl.svg
@@ -0,0 +1,23 @@
+
+
diff --git a/static/img/php.svg b/static/img/php.svg
new file mode 100644
index 0000000000..72e0774892
--- /dev/null
+++ b/static/img/php.svg
@@ -0,0 +1,96 @@
+
+
diff --git a/static/img/python.svg b/static/img/python.svg
new file mode 100644
index 0000000000..366f52f339
--- /dev/null
+++ b/static/img/python.svg
@@ -0,0 +1,113 @@
+
+
+
diff --git a/static/img/r.svg b/static/img/r.svg
new file mode 100644
index 0000000000..389b03c113
--- /dev/null
+++ b/static/img/r.svg
@@ -0,0 +1,14 @@
+
diff --git a/static/img/ruby.svg b/static/img/ruby.svg
new file mode 100644
index 0000000000..e7d431ed60
--- /dev/null
+++ b/static/img/ruby.svg
@@ -0,0 +1,947 @@
+
+
+
\ No newline at end of file
diff --git a/static/img/rust.svg b/static/img/rust.svg
new file mode 100644
index 0000000000..81131b74ee
--- /dev/null
+++ b/static/img/rust.svg
@@ -0,0 +1,19 @@
+
+
+
\ No newline at end of file
diff --git a/static/img/scala.svg b/static/img/scala.svg
new file mode 100644
index 0000000000..91acfd11b8
--- /dev/null
+++ b/static/img/scala.svg
@@ -0,0 +1,20 @@
+
+
diff --git a/static/img/swift.svg b/static/img/swift.svg
new file mode 100644
index 0000000000..69df9cd20a
--- /dev/null
+++ b/static/img/swift.svg
@@ -0,0 +1,10 @@
+
+
From c2efe52e63aec71d79af4a93819d9fcad1f162e3 Mon Sep 17 00:00:00 2001
From: Arda TANRIKULU
Date: Fri, 23 Oct 2020 04:38:28 +0300
Subject: [PATCH 008/439] New code.json
---
data/code.json | 271 ++++++++++++++++++++++++++++++++++
data/js-graphql-clients.json | 72 ---------
data/js-server-libraries.json | 26 ----
data/tools.json | 99 -------------
gatsby-node.js | 6 +-
scripts/sort-libraries.js | 8 +
src/pages/code.tsx | 67 ++-------
7 files changed, 293 insertions(+), 256 deletions(-)
create mode 100644 data/code.json
delete mode 100644 data/js-graphql-clients.json
delete mode 100644 data/js-server-libraries.json
delete mode 100644 data/tools.json
diff --git a/data/code.json b/data/code.json
new file mode 100644
index 0000000000..f698d515ff
--- /dev/null
+++ b/data/code.json
@@ -0,0 +1,271 @@
+{
+ "Libraries": {
+ "C# / .NET": {
+ "Server Libraries": [
+ {
+ "name": "graphql-dotnet",
+ "description": "GraphQL for .NET",
+ "howto": "```csharp\nusing System;\nusing GraphQL;\nusing GraphQL.Types;\n\npublic class Program\n{\n public static void Main(string[] args)\n {\n var schema = Schema.For(@\"\n type Query {\n hello: String\n }\n \");\n\n var json = schema.Execute(_ =>\n {\n _.Query = \"{ hello }\";\n _.Root = new { Hello = \"Hello World!\" };\n });\n\n Console.WriteLine(json);\n }\n} \n```",
+ "url": "https://github.com/graphql-dotnet/graphql-dotnet",
+ "github": "graphql-dotnet/graphql-dotnet"
+ },
+ {
+ "name": "graphql-net",
+ "description": "Convert GraphQL to IQueryable",
+ "url": "https://github.com/ckimes89/graphql-net",
+ "github": "ckimes89/graphql-net"
+ },
+ {
+ "name": "Entity GraphQL",
+ "description": ".NET Core GraphQL library. Compiles to IQueryable to easily expose a schema from an existing data model (E.g. from an Entity Framework data model)",
+ "url": "https://github.com/lukemurray/EntityGraphQL",
+ "github": "lukemurray/EntityGraphQL"
+ },
+ {
+ "name": "Hot Chocolate",
+ "description": "GraphQL Server for .NET core and .NET classic",
+ "url": "https://github.com/ChilliCream/hotchocolate",
+ "github": "ChilliCream/hotchocolate"
+ }
+ ],
+ "GraphQL Clients": [
+ {
+ "name": "GraphQL.Client",
+ "description": "A GraphQL Client for .NET.",
+ "url": "https://github.com/graphql-dotnet/graphql-client",
+ "github": "graphql-dotnet/graphql-client"
+ },
+ {
+ "name": "graphql-net-client",
+ "description": "Basic example GraphQL client for .NET.",
+ "url": "https://github.com/bkniffler/graphql-net-client",
+ "github": "bkniffler/graphql-net-client"
+ },
+ {
+ "name": "SAHB.GraphQLClient",
+ "description": "GraphQL client which supports generating queries from C# classes",
+ "url": "https://github.com/sahb1239/SAHB.GraphQLClient",
+ "github": "SAHB.GraphQLClient"
+ }
+ ]
+ },
+ "JavaScript": {
+ "GraphQL Clients": [
+ {
+ "name": "Relay",
+ "description": "Facebook's framework for building React applications that talk to a GraphQL backend.",
+ "url": "https://facebook.github.io/relay/",
+ "npm": "react-relay",
+ "github": "facebook/relay"
+ },
+ {
+ "name": "Apollo Client",
+ "description": "A powerful JavaScript GraphQL client, designed to work well with React, React Native, Angular 2, or just plain JavaScript.",
+ "url": "http://apollographql.com/client/",
+ "npm": "@apollo/client",
+ "github": "apollographql/apollo-client"
+ },
+ {
+ "name": "GraphQL Request",
+ "description": "A simple and flexible JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native) - basically a lightweight wrapper around `fetch`.",
+ "url": "https://github.com/prisma/graphql-request",
+ "npm": "graphql-request",
+ "github": "prisma-labs/graphql-request"
+ },
+ {
+ "name": "Lokka",
+ "description": "A simple JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native).",
+ "url": "https://github.com/kadirahq/lokka",
+ "npm": "lokka",
+ "github": "kadirahq/lokka"
+ },
+ {
+ "name": "nanogql",
+ "description": "Tiny GraphQL client library using template strings.",
+ "url": "https://github.com/yoshuawuyts/nanogql",
+ "npm": "nanographql",
+ "github": "choojs/nanographql"
+ },
+ {
+ "name": "gq-loader",
+ "description": "A simple JavaScript GraphQL client,Let the *.gql file be used as a module through webpack loader.",
+ "url": "https://github.com/Houfeng/gq-loader",
+ "npm": "gq-loader",
+ "github": "Houfeng/gq-loader"
+ },
+ {
+ "name": "AWS Amplify",
+ "description": "A JavaScript library for application development using cloud services, which supports GraphQL backend and React components for working with GraphQL data.",
+ "url": "https://docs.amplify.aws/",
+ "npm": "aws-amplify",
+ "github": "aws-amplify/amplify-js"
+ },
+ {
+ "name": "Grafoo",
+ "description": "An all purpose GraphQL client with view layer integrations for multiple frameworks in just 1.6kb.",
+ "url": "https://github.com/grafoojs/grafoo",
+ "npm": "@grafoo/core",
+ "github": "grafoojs/grafoo"
+ },
+ {
+ "name": "urql",
+ "description": "A highly customizable and versatile GraphQL client for React.",
+ "url": "https://formidable.com/open-source/urql/",
+ "npm": "urql",
+ "github": "FormidableLabs/urql"
+ },
+ {
+ "name": "graphqurl",
+ "description": "curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.",
+ "url": "https://github.com/hasura/graphqurl",
+ "npm": "graphqurl",
+ "github": "hasura/graphqurl"
+ }
+ ],
+ "Server Libraries": [
+ {
+ "name": "GraphQL.js",
+ "description": "The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.",
+ "howto": "To run a `GraphQL.js` hello world script from the command line:\n\n```bash\nnpm install graphql\n```\n\nThen run `node hello.js` with this code in `hello.js`:\n\n```js\nvar { graphql, buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\ngraphql(schema, '{ hello }', root).then((response) => {\n console.log(response);\n});\n```",
+ "url": "/graphql-js/",
+ "npm": "graphql",
+ "github": "graphql/graphql-js"
+ },
+ {
+ "name": "Express GraphQL",
+ "description": "The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.",
+ "howto": "To run an `express-graphql` hello world server:\n\n```bash\nnpm install express express-graphql graphql\n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nvar express = require('express');\nvar { graphqlHTTP } = require('express-graphql');\nvar { buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\nvar app = express();\napp.use('/graphql', graphqlHTTP({\n schema: schema,\n rootValue: root,\n graphiql: true,\n}));\napp.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));\n```",
+ "url": "/graphql-js/running-an-express-graphql-server/",
+ "npm": "express-graphql",
+ "github": "graphql/express-graphql"
+ },
+ {
+ "name": "Apollo Server",
+ "description": "A set of GraphQL server packages from Apollo that work with various Node.js HTTP frameworks (Express, Connect, Hapi, Koa etc).",
+ "howto": "To run a hello world server with apollo-server-express:\n\n```bash\nnpm install apollo-server-express express \n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nconst express = require('express');\nconst { ApolloServer, gql } = require('apollo-server-express');\n\nconst typeDefs = gql`\n type Query {\n hello: String\n }\n`;\n\nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n\nconst server = new ApolloServer({ typeDefs, resolvers });\n\nconst app = express();\nserver.applyMiddleware({ app });\n\napp.listen({ port: 4000 }, () =>\n console.log('Now browse to http://localhost:4000' + server.graphqlPath)\n);\n```\n\nApollo Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI, Koa and NestJs.",
+ "url": "https://www.apollographql.com/docs/apollo-server/",
+ "npm": "apollo-server-express",
+ "github": "apollographql/apollo-server"
+ }
+ ]
+ },
+ "Ruby": {
+ "Server Libraries": [
+ {
+ "name": "graphql-ruby",
+ "description": "A Ruby library for building GraphQL APIs.",
+ "howto": "To run a hello world script with `graphql-ruby`:\n```bash\ngem install graphql\n```\n\nThen run `ruby hello.rb` with this code in `hello.rb`:\n\n```ruby\nrequire 'graphql'\n\nclass QueryType < GraphQL::Schema::Object\n graphql_name 'Query'\n field :hello do\n type types.String\n resolve -> (obj, args, ctx) { 'Hello world!' }\n end\nend\n\nclass Schema < GraphQL::Schema\n query QueryType\nend\n\nputs Schema.execute('{ hello }').to_json\n```\nThere are also nice bindings for Relay and Rails.",
+ "url": "https://github.com/rmosolgo/graphql-ruby",
+ "gem": "graphql",
+ "github": "rmosolgo/graphql-ruby"
+ },
+ {
+ "name": "Agoo",
+ "description": "A high performance web server with support for GraphQL. Agoo strives for a simple, easy to use API for GraphQL.",
+ "howto": "```ruby\nrequire 'agoo'\n\nclass Query\n def hello\n 'hello'\n end\nend\n\nclass Schema\n attr_reader :query\n\n def initialize\n @query = Query.new()\n end\nend\n\nAgoo::Server.init(6464, 'root', thread_count: 1, graphql: '/graphql')\nAgoo::Server.start()\nAgoo::GraphQL.schema(Schema.new) {\n Agoo::GraphQL.load(%^type Query { hello: String }^)\n}\nsleep\n\n# To run this GraphQL example type the following then go to a browser and enter\n# a URL of localhost:6464/graphql?query={hello}\n#\n# ruby hello.rb\n```",
+ "gem": "agoo",
+ "github": "ohler55/agoo"
+ }
+ ]
+ }
+ },
+ "Tools": [
+ {
+ "name": "GraphiQL",
+ "description": "An interactive in-browser GraphQL IDE.",
+ "url": "https://github.com/graphql/graphiql",
+ "npm": "graphiql",
+ "github": "graphql/graphiql"
+ },
+ {
+ "name": "libgraphqlparser",
+ "description": "A GraphQL query language parser in C++ with C and C++ APIs.",
+ "url": "https://github.com/graphql/libgraphqlparser",
+ "github": "graphql/libgraphqlparser"
+ },
+ {
+ "name": "GraphQL Language Service",
+ "description": "An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).",
+ "url": "https://github.com/graphql/graphql-language-service",
+ "npm": "graphql-language-service",
+ "github": "graphql/graphql-language-service"
+ },
+ {
+ "name": "quicktype",
+ "description": "Generate types for GraphQL queries in TypeScript, Swift, golang, C#, C++, and more.",
+ "url": "https://quicktype.io/",
+ "npm": "quicktype",
+ "github": "quicktype/quicktype"
+ },
+ {
+ "name": "GraphQL-ESLint",
+ "description": "GraphQL-ESLint integrates GraphQL AST in the ESLint core (as a parser).",
+ "url": "https://github.com/dotansimha/graphql-eslint/",
+ "npm": "@graphql-eslint/eslint-plugin",
+ "github": "dotansimha/graphql-eslint/"
+ },
+ {
+ "name": "GraphQL Modules",
+ "description": "GraphQL Modules lets you separate your backend implementation to small, reusable, easy-to-implement and easy-to-test pieces.",
+ "url": "https://graphql-modules.com",
+ "npm": "graphql-modules",
+ "github": "Urigo/graphql-modules"
+ },
+ {
+ "name": "GraphQL Tools",
+ "description": "A set of utils for faster development of GraphQL tools (Schema and documents loading, Schema merging and more).",
+ "url": "https://graphql-tools.com",
+ "npm": "graphql-tools",
+ "github": "ardatan/graphql-tools"
+ },
+ {
+ "name": "GraphQL Config",
+ "description": "One configuration for all your GraphQL tools (supported by most tools, editors & IDEs).",
+ "url": "https://graphql-config.com",
+ "npm": "graphql-config",
+ "github": "kamilkisiela/graphql-config"
+ },
+ {
+ "name": "GraphQL Mesh",
+ "description": "GraphQL Mesh allows you to use GraphQL query language to access data in remote APIs that don't run GraphQL (and also ones that do run GraphQL). It can be used as a gateway to other services, or run as a local GraphQL schema that aggregates data from remote APIs.",
+ "url": "https://graphql-mesh.com",
+ "npm": "@graphql-mesh/cli",
+ "github": "Urigo/graphql-mesh"
+ },
+ {
+ "name": "GraphQL Code Generator",
+ "description": "GraphQL code generator with flexible support for custom plugins and templates like Typescript (frontend and backend), React Hooks, resolvers signatures and more.",
+ "url": "https://graphql-code-generator.com",
+ "npm": "@graphql-codegen/cli",
+ "github": "dotansimha/graphql-code-generator"
+ },
+ {
+ "name": "GraphQL CLI",
+ "description": "A command line tool for common GraphQL development workflows.",
+ "url": "https://graphql-cli.com",
+ "npm": "graphql-cli",
+ "github": "Urigo/graphql-cli"
+ },
+ {
+ "name": "GraphQL Inspector",
+ "description": "Compare schemas, validate documents, find breaking changes, find similar types, schema coverage, and more.",
+ "url": "https://graphql-inspector.com/",
+ "npm": "@graphql-inspector/cli",
+ "github": "kamilkisiela/graphql-inspector"
+ },
+ {
+ "name": "GraphQL Scalars",
+ "description": "A library of custom GraphQL scalar types for creating precise, type-safe GraphQL schemas.",
+ "url": "https://github.com/Urigo/graphql-scalars",
+ "npm": "graphql-scalars",
+ "github": "Urigo/graphql-scalars"
+ },
+ {
+ "name": "SOFA",
+ "description": "Generate REST API from your GraphQL API.",
+ "url": "https://sofa-api.com/",
+ "npm": "sofa-api",
+ "github": "Urigo/SOFA"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/data/js-graphql-clients.json b/data/js-graphql-clients.json
deleted file mode 100644
index 8229754fcf..0000000000
--- a/data/js-graphql-clients.json
+++ /dev/null
@@ -1,72 +0,0 @@
-[
- {
- "name": "Relay",
- "description": "Facebook's framework for building React applications that talk to a GraphQL backend.",
- "url": "https://facebook.github.io/relay/",
- "npm": "react-relay",
- "github": "facebook/relay"
- },
- {
- "name": "Apollo Client",
- "description": "A powerful JavaScript GraphQL client, designed to work well with React, React Native, Angular 2, or just plain JavaScript.",
- "url": "http://apollographql.com/client/",
- "npm": "@apollo/client",
- "github": "apollographql/apollo-client"
- },
- {
- "name": "GraphQL Request",
- "description": "A simple and flexible JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native) - basically a lightweight wrapper around `fetch`.",
- "url": "https://github.com/prisma/graphql-request",
- "npm": "graphql-request",
- "github": "prisma-labs/graphql-request"
- },
- {
- "name": "Lokka",
- "description": "A simple JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native).",
- "url": "https://github.com/kadirahq/lokka",
- "npm": "lokka",
- "github": "kadirahq/lokka"
- },
- {
- "name": "nanogql",
- "description": "Tiny GraphQL client library using template strings.",
- "url": "https://github.com/yoshuawuyts/nanogql",
- "npm": "nanographql",
- "github": "yoshuawuyts/nanographql"
- },
- {
- "name": "gq-loader",
- "description": "A simple JavaScript GraphQL client,Let the *.gql file be used as a module through webpack loader.",
- "url": "https://github.com/Houfeng/gq-loader",
- "npm": "gq-loader",
- "github": "Houfeng/gq-loader"
- },
- {
- "name": "AWS Amplify",
- "description": "A JavaScript library for application development using cloud services, which supports GraphQL backend and React components for working with GraphQL data.",
- "url": "https://docs.amplify.aws/",
- "npm": "aws-amplify",
- "github": "aws-amplify/amplify-js"
- },
- {
- "name": "Grafoo",
- "description": "An all purpose GraphQL client with view layer integrations for multiple frameworks in just 1.6kb.",
- "url": "https://github.com/grafoojs/grafoo",
- "npm": "@grafoo/core",
- "github": "grafoojs/grafoo"
- },
- {
- "name": "urql",
- "description": "A highly customizable and versatile GraphQL client for React.",
- "url": "https://formidable.com/open-source/urql/",
- "npm": "urql",
- "github": "FormidableLabs/urql"
- },
- {
- "name": "graphqurl",
- "description": "curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.",
- "url": "https://github.com/hasura/graphqurl",
- "npm": "graphqurl",
- "github": "hasura/graphqurl"
- }
-]
\ No newline at end of file
diff --git a/data/js-server-libraries.json b/data/js-server-libraries.json
deleted file mode 100644
index 848ab3623a..0000000000
--- a/data/js-server-libraries.json
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "name": "GraphQL.js",
- "description": "The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.",
- "howto": "To run a `GraphQL.js` hello world script from the command line:\n\n```bash\nnpm install graphql\n```\n\nThen run `node hello.js` with this code in `hello.js`:\n\n```js\nvar { graphql, buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\ngraphql(schema, '{ hello }', root).then((response) => {\n console.log(response);\n});\n```",
- "url": "/graphql-js/",
- "npm": "graphql",
- "github": "graphql/graphql-js"
- },
- {
- "name": "Express GraphQL",
- "description": "The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.",
- "howto": "To run an `express-graphql` hello world server:\n\n```bash\nnpm install express express-graphql graphql\n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nvar express = require('express');\nvar { graphqlHTTP } = require('express-graphql');\nvar { buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\nvar app = express();\napp.use('/graphql', graphqlHTTP({\n schema: schema,\n rootValue: root,\n graphiql: true,\n}));\napp.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));\n```",
- "url": "/graphql-js/running-an-express-graphql-server/",
- "npm": "express-graphql",
- "github": "graphql/express-graphql"
- },
- {
- "name": "Apollo Server",
- "description": "A set of GraphQL server packages from Apollo that work with various Node.js HTTP frameworks (Express, Connect, Hapi, Koa etc).",
- "howto": "To run a hello world server with apollo-server-express:\n\n```bash\nnpm install apollo-server-express express \n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nconst express = require('express');\nconst { ApolloServer, gql } = require('apollo-server-express');\n\nconst typeDefs = gql`\n type Query {\n hello: String\n }\n`;\n\nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n\nconst server = new ApolloServer({ typeDefs, resolvers });\n\nconst app = express();\nserver.applyMiddleware({ app });\n\napp.listen({ port: 4000 }, () =>\n console.log('Now browse to http://localhost:4000' + server.graphqlPath)\n);\n```\n\nApollo Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI, Koa and NestJs.",
- "url": "https://www.apollographql.com/docs/apollo-server/",
- "npm": "apollo-server-express",
- "github": "apollographql/apollo-server"
- }
-]
\ No newline at end of file
diff --git a/data/tools.json b/data/tools.json
deleted file mode 100644
index f60b6ac77a..0000000000
--- a/data/tools.json
+++ /dev/null
@@ -1,99 +0,0 @@
-[
- {
- "name": "GraphiQL",
- "description": "An interactive in-browser GraphQL IDE.",
- "url": "https://github.com/graphql/graphiql",
- "npm": "graphiql",
- "github": "graphql/graphiql"
- },
- {
- "name": "libgraphqlparser",
- "description": "A GraphQL query language parser in C++ with C and C++ APIs.",
- "url": "https://github.com/graphql/libgraphqlparser",
- "github": "graphql/libgraphqlparser"
- },
- {
- "name": "GraphQL Language Service",
- "description": "An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).",
- "url": "https://github.com/graphql/graphql-language-service",
- "npm": "graphql-language-service",
- "github": "graphql/graphql-language-service"
- },
- {
- "name": "quicktype",
- "description": "Generate types for GraphQL queries in TypeScript, Swift, golang, C#, C++, and more.",
- "url": "https://quicktype.io/",
- "npm": "quicktype",
- "github": "quicktype/quicktype"
- },
- {
- "name": "GraphQL-ESLint",
- "description": "GraphQL-ESLint integrates GraphQL AST in the ESLint core (as a parser).",
- "url": "https://github.com/dotansimha/graphql-eslint/",
- "npm": "@graphql-eslint/eslint-plugin",
- "github": "dotansimha/graphql-eslint/"
- },
- {
- "name": "GraphQL Modules",
- "description": "GraphQL Modules lets you separate your backend implementation to small, reusable, easy-to-implement and easy-to-test pieces.",
- "url": "https://graphql-modules.com",
- "npm": "graphql-modules",
- "github": "Urigo/graphql-modules"
- },
- {
- "name": "GraphQL Tools",
- "description": "A set of utils for faster development of GraphQL tools (Schema and documents loading, Schema merging and more).",
- "url": "https://graphql-tools.com",
- "npm": "graphql-tools",
- "github": "ardatan/graphql-tools"
- },
- {
- "name": "GraphQL Config",
- "description": "One configuration for all your GraphQL tools (supported by most tools, editors & IDEs).",
- "url": "https://graphql-config.com",
- "npm": "graphql-config",
- "github": "kamilkisiela/graphql-config"
- },
- {
- "name": "GraphQL Mesh",
- "description": "GraphQL Mesh allows you to use GraphQL query language to access data in remote APIs that don't run GraphQL (and also ones that do run GraphQL). It can be used as a gateway to other services, or run as a local GraphQL schema that aggregates data from remote APIs.",
- "url": "https://graphql-mesh.com",
- "npm": "@graphql-mesh/cli",
- "github": "Urigo/graphql-mesh"
- },
- {
- "name": "GraphQL Code Generator",
- "description": "GraphQL code generator with flexible support for custom plugins and templates like Typescript (frontend and backend), React Hooks, resolvers signatures and more.",
- "url": "https://graphql-code-generator.com",
- "npm": "@graphql-codegen/cli",
- "github": "dotansimha/graphql-code-generator"
- },
- {
- "name": "GraphQL CLI",
- "description": "A command line tool for common GraphQL development workflows.",
- "url": "https://graphql-cli.com",
- "npm": "graphql-cli",
- "github": "Urigo/graphql-cli"
- },
- {
- "name": "GraphQL Inspector",
- "description": "Compare schemas, validate documents, find breaking changes, find similar types, schema coverage, and more.",
- "url": "https://graphql-inspector.com/",
- "npm": "@graphql-inspector/cli",
- "github": "kamilkisiela/graphql-inspector"
- },
- {
- "name": "GraphQL Scalars",
- "description": "A library of custom GraphQL scalar types for creating precise, type-safe GraphQL schemas.",
- "url": "https://github.com/Urigo/graphql-scalars",
- "npm": "graphql-scalars",
- "github": "Urigo/graphql-scalars"
- },
- {
- "name": "SOFA",
- "description": "Generate REST API from your GraphQL API.",
- "url": "https://sofa-api.com/",
- "npm": "sofa-api",
- "github": "Urigo/SOFA"
- }
-]
\ No newline at end of file
diff --git a/gatsby-node.js b/gatsby-node.js
index 82b904ee78..177f44f490 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -10,13 +10,16 @@ exports.onCreatePage = async ({ page, actions }) => {
sourcePath: path.relative(__dirname, page.componentPath),
}
if (page.path === "/code" || page.path === "/code/") {
- const [jsGraphQLClients, jsServerLibraries, tools] = await Promise.all([
+ const [jsGraphQLClients, jsServerLibraries, rubyServerLibraries, tools] = await Promise.all([
sortLibs(
JSON.parse(readFileSync("./data/js-graphql-clients.json", "utf8"))
),
sortLibs(
JSON.parse(readFileSync("./data/js-server-libraries.json", "utf8"))
),
+ sortLibs(
+ JSON.parse(readFileSync("./data/ruby-server-libraries.json", "utf8"))
+ ),
sortLibs(JSON.parse(readFileSync("./data/tools.json", "utf8"))),
])
@@ -24,6 +27,7 @@ exports.onCreatePage = async ({ page, actions }) => {
...context,
jsGraphQLClients,
jsServerLibraries,
+ rubyServerLibraries,
tools,
}
}
diff --git a/scripts/sort-libraries.js b/scripts/sort-libraries.js
index ef187c2cc8..46d392b6db 100644
--- a/scripts/sort-libraries.js
+++ b/scripts/sort-libraries.js
@@ -91,11 +91,19 @@ const getNpmStats = async packageName => {
return { downloadCount }
}
+const getGemStats = async packageName => {
+ const response = await fetch(`https://rubygems.org/api/v1/gems/${encodeURIComponent(packageName)}.json`);
+ const responseJson = await response.json()
+ const downloadCount = responseJson.downloads
+ return { downloadCount }
+}
+
const sortLibs = async libs => {
const libsWithScores = await Promise.all(
libs.map(async lib => {
const [npmStats = {}, githubStats = {}] = await Promise.all([
lib.npm && getNpmStats(lib.npm),
+ lib.gem && getGemStats(lib.gem),
lib.github && getGitHubStats(lib.github),
])
return {
diff --git a/src/pages/code.tsx b/src/pages/code.tsx
index 9ad5447d36..0b89384e96 100644
--- a/src/pages/code.tsx
+++ b/src/pages/code.tsx
@@ -813,64 +813,15 @@ There are also nice bindings for [Relay](https://facebook.github.io/relay/), Dja
## Ruby
### Server Libraries
-#### [graphql-ruby](https://github.com/rmosolgo/graphql-ruby)
-A Ruby library for building GraphQL APIs.
-To run a hello world script with \`graphql-ruby\`:
-\`\`\`bash
-gem install graphql
-\`\`\`
-
-Then run \`ruby hello.rb\` with this code in \`hello.rb\`:
-
-\`\`\`ruby
-require 'graphql'
-
-class QueryType < GraphQL::Schema::Object
- graphql_name 'Query'
- field :hello do
- type types.String
- resolve -> (obj, args, ctx) { 'Hello world!' }
- end
-end
-
-class Schema < GraphQL::Schema
- query QueryType
-end
-
-puts Schema.execute('{ hello }').to_json
-\`\`\`
-There are also nice bindings for Relay and Rails.
-#### [Agoo](https://github.com/ohler55/agoo)
-A high performance web server with support for GraphQL. Agoo strives for a simple, easy to use API for GraphQL.
-\`\`\`ruby
-require 'agoo'
-
-class Query
- def hello
- 'hello'
- end
-end
-
-class Schema
- attr_reader :query
-
- def initialize
- @query = Query.new()
- end
-end
-
-Agoo::Server.init(6464, 'root', thread_count: 1, graphql: '/graphql')
-Agoo::Server.start()
-Agoo::GraphQL.schema(Schema.new) {
- Agoo::GraphQL.load(%^type Query { hello: String }^)
-}
-sleep
-
-# To run this GraphQL example type the following then go to a browser and enter
-# a URL of localhost:6464/graphql?query={hello}
-#
-# ruby hello.rb
-\`\`\`
+${pageContext.rubyServerLibraries
+ .map(
+ (
+ library: any
+ ) => `#### [${library.name}](${library.url}) ([github](https://github.com/${library.github})) ([gem](https://rubygems.org/gems/${library.npm}))
+${library.description}
+${library.howto}`
+ )
+ .join("\n")}
## Rust
### Server Libraries
From 8729d1dac5633018df6bb4d1d80c9ffe4f3ae107 Mon Sep 17 00:00:00 2001
From: Arda TANRIKULU
Date: Mon, 26 Oct 2020 19:56:55 +0300
Subject: [PATCH 009/439] Move all libraries to data.json
---
data/code.json | 527 +++++++++++-
gatsby-node.js | 30 +-
scripts/sort-libraries.js | 55 +-
src/pages/code.tsx | 952 +++------------------
static/img/d.svg | 215 +++++
static/img/{golang.svg => go.svg} | 0
static/img/haskell.svg | 12 +
static/img/{java.svg => java-android.svg} | 0
static/img/{node.svg => javascript.svg} | 0
static/img/{ocaml.svg => ocaml-reason.svg} | 0
10 files changed, 906 insertions(+), 885 deletions(-)
create mode 100644 static/img/d.svg
rename static/img/{golang.svg => go.svg} (100%)
create mode 100644 static/img/haskell.svg
rename static/img/{java.svg => java-android.svg} (100%)
rename static/img/{node.svg => javascript.svg} (100%)
rename static/img/{ocaml.svg => ocaml-reason.svg} (100%)
diff --git a/data/code.json b/data/code.json
index f698d515ff..067c12e2c3 100644
--- a/data/code.json
+++ b/data/code.json
@@ -13,7 +13,7 @@
"name": "graphql-net",
"description": "Convert GraphQL to IQueryable",
"url": "https://github.com/ckimes89/graphql-net",
- "github": "ckimes89/graphql-net"
+ "github": "chkimes/graphql-net"
},
{
"name": "Entity GraphQL",
@@ -45,11 +45,253 @@
"name": "SAHB.GraphQLClient",
"description": "GraphQL client which supports generating queries from C# classes",
"url": "https://github.com/sahb1239/SAHB.GraphQLClient",
- "github": "SAHB.GraphQLClient"
+ "github": "sahb1239/SAHB.GraphQLClient"
}
]
},
+ "Clojure": {
+ "Server Libraries": [
+ {
+ "name": "alumbra",
+ "description": "A set of reusable GraphQL components for Clojure conforming to the data structures given in [alumbra.spec](https://github.com/alumbra/alumbra.spec).",
+ "howto": "```clojure\n(require '[alumbra.core :as alumbra]\n '[claro.data :as data])\n\n(def schema\n \"type Person { name: String!, friends: [Person!]! }\n type QueryRoot { person(id: ID!): Person, me: Person! }\n schema { query: QueryRoot }\")\n\n(defrecord Person [id]\n data/Resolvable\n (resolve! [_ _]\n {:name (str \"Person #\" id)\n :friends (map ->Person (range (inc id) (+ id 3)))}))\n\n(def QueryRoot\n {:person (map->Person {})\n :me (map->Person {:id 0})})\n\n(def app\n (alumbra/handler\n {:schema schema\n :query QueryRoot}))\n\n(defonce my-graphql-server\n (aleph.http/start-server #'app {:port 3000}))\n```\n\n```bash\n$ curl -XPOST \"http://0:3000\" -H'Content-Type: application/json' -d'{\n \"query\": \"{ me { name, friends { name } } }\"\n}'\n{\"data\":{\"me\":{\"name\":\"Person #0\",\"friends\":[{\"name\":\"Person #1\"},{\"name\":\"Person #2\"}]}}}\n```",
+ "url": "https://github.com/alumbra/alumbra",
+ "github": "alumbra/alumbra"
+ },
+ {
+ "name": "graphql-clj",
+ "description": "A Clojure library that provides a GraphQL implementation.",
+ "howto": "Code that executes a hello world GraphQL query with `graphql-clj`:\n```clojure\n\n(def schema \"type QueryRoot {\n hello: String\n }\")\n\n(defn resolver-fn [type-name field-name]\n (get-in {\"QueryRoot\" {\"hello\" (fn [context parent & rest]\n \"Hello world!\")}}\n [type-name field-name]))\n\n(require '[graphql-clj.executor :as executor])\n\n(executor/execute nil schema resolver-fn \"{ hello }\")\n```",
+ "url": "https://github.com/tendant/graphql-clj",
+ "github": "tendant/graphql-clj"
+ },
+ {
+ "name": "lacinia",
+ "description": "A full implementation of the GraphQL specification that aims to maintain external compliance with the specification.",
+ "github": "walmartlabs/lacinia",
+ "url": "https://github.com/walmartlabs/lacinia"
+ }
+ ],
+ "GraphQL Clients": [
+ {
+ "name": "regraph",
+ "description": "A GraphQL client implemented in Clojurescript with support for websockets.",
+ "github": "oliyh/re-graph",
+ "url": "https://github.com/oliyh/re-graph/"
+ }
+ ]
+ },
+ "D": {
+ "Server Libraries": [
+ {
+ "name": "graphqld",
+ "description": "A GraphQL implementaiton for the D Programming Language.",
+ "github": "https://github.com/burner/graphqld",
+ "url": "https://github.com/burner/graphqld"
+ }
+ ]
+ },
+ "Elixir": {
+ "GraphQL Clients": [
+ {
+ "name": "Neuron",
+ "description": "A GraphQL client for Elixir",
+ "github": "https://github.com/uesteibar/neuron",
+ "url": "https://github.com/uesteibar/neuron"
+ },
+ {
+ "name": "common_graphql_client",
+ "description": "Elixir GraphQL Client with HTTP and WebSocket support",
+ "github": "https://github.com/annkissam/common_graphql_client",
+ "url": "https://github.com/annkissam/common_graphql_client"
+ }
+ ],
+ "Server Libraries": [
+ {
+ "name": "absinthe",
+ "description": "GraphQL implementation for Elixir.",
+ "github": "absinthe-graphql/absinthe",
+ "url": "https://github.com/absinthe-graphql/absinthe"
+ },
+ {
+ "name": "graphql-elixir",
+ "description": "An Elixir implementation of Facebook's GraphQL.",
+ "github": "graphql-elixir/graphql",
+ "url": "https://github.com/graphql-elixir/graphql"
+ }
+ ]
+ },
+ "Elm": {
+ "GraphQL Clients": [
+ {
+ "name": "dillonkearns/elm-graphql",
+ "description": "Library and command-line code generator to create type-safe Elm code for a GraphQL endpoint.",
+ "url": "https://github.com/dillonkearns/elm-graphql",
+ "github": "dillonkearns/elm-graphql"
+ }
+ ]
+ },
+ "Erlang": {
+ "Server Libraries": [
+ {
+ "name": "graphql-erlang",
+ "description": "GraphQL implementation in Erlang.",
+ "url": "https://github.com/shopgun/graphql-erlang",
+ "github": "jlouis/graphql-erlang"
+ }
+ ]
+ },
+ "Flutter": {
+ "GraphQL Clients": [
+ {
+ "name": "graphql",
+ "description": "A GraphQL client implementation in Flutter.",
+ "url": "https://github.com/zino-app/graphql-flutter#readme",
+ "github": "zino-app/graphql-flutter"
+ }
+ ]
+ },
+ "Go": {
+ "Server Libraries": [
+ {
+ "name": "graphql-go",
+ "description": "An implementation of GraphQL for Go / Golang.",
+ "url": "https://github.com/graphql-go/graphql",
+ "github": "graphql-go/graphql"
+ },
+ {
+ "name": "graph-gophers/graphql-go",
+ "description": "An active implementation of GraphQL in Golang (was https://github.com/neelance/graphql-go).",
+ "url": "https://github.com/graph-gophers/graphql-go",
+ "github": "graph-gophers/graphql-go"
+ },
+ {
+ "name": "99designs/gqlgen",
+ "description": "Go generate based graphql server library.",
+ "url": "https://github.com/99designs/gqlgen",
+ "github": "99designs/gqlgen"
+ },
+ {
+ "name": "graphql-relay-go",
+ "description": "A Go/Golang library to help construct a graphql-go server supporting react-relay.",
+ "url": "https://github.com/graphql-go/relay",
+ "github": "graphql-go/relay"
+ },
+ {
+ "name": "machinebox/graphql",
+ "description": "An elegant low-level HTTP client for GraphQL.",
+ "url": "https://github.com/machinebox/graphql",
+ "github": "machinebox/graphql"
+ },
+ {
+ "name": "samsarahq/thunder",
+ "description": "A GraphQL implementation with easy schema building, live queries, and batching.",
+ "url": "https://github.com/samsarahq/thunder",
+ "github": "samsarahq/thunder"
+ },
+ {
+ "name": "appointy/jaal",
+ "description": "Develop spec compliant GraphQL servers in Go.",
+ "url": "https://github.com/appointy/jaal",
+ "github": "appointy/jaal"
+ }
+ ],
+ "GraphQL Clients": [
+ {
+ "name": "graphql",
+ "description": "A GraphQL client implementation in Go.",
+ "url": "https://github.com/shurcooL/graphql#readme",
+ "github": "shurcooL/graphql"
+ }
+ ]
+ },
+ "Groovy": {
+ "Server Libraries": [
+ {
+ "name": "gorm-graphql",
+ "howto": "**Core Library** - The GORM GraphQL library provides functionality to generate a GraphQL schema based on your GORM entities. In addition to mapping domain classes to a GraphQL schema, the core library also provides default implementations of \"data fetchers\" to query, update, and delete data through executions of the schema.\n\n**Grails Plugin** - In a addition to the Core Library, the GORM GraphQL Grails Plugin:\n\n- Provides a controller to receive and respond to GraphQL requests through HTTP, based on their guidelines.\n\n- Generates the schema at startup with spring bean configuration to make it easy to extend.\n\n- Includes a [GraphiQL](https://github.com/graphql/graphiql) browser enabled by default in development. The browser is accessible at /graphql/browser.\n\n- Overrides the default data binder to use the data binding provided by Grails\n- Provides a [trait](https://grails.github.io/gorm-graphql/latest/api/org/grails/gorm/graphql/plugin/testing/GraphQLSpec.html) to make integration testing of your GraphQL endpoints easier\n\nSee [the documentation](https://grails.github.io/gorm-graphql/latest/guide/index.html) for more information.",
+ "github": "grails/gorm-graphql",
+ "url": "https://github.com/grails/gorm-graphql/"
+ },
+ {
+ "name": "GQL",
+ "description": "GQL is a Groove library for GraphQL",
+ "url": "https://grooviter.github.io/gql/",
+ "github": "grooviter/gql"
+ }
+ ]
+ },
+ "Haskell": {
+ "Server Libraries": [
+ {
+ "name": "Morpheus GraphQL",
+ "description": "A Haskell library for building GraphQL APIs.",
+ "howto": "\nHello world example with `morpheus-graphql`:\n\n```graphql\n# schema.gql\n\"\"\"\nA supernatural being considered divine and sacred\n\"\"\"\ntype Deity {\n name: String!\n power: String @deprecated(reason: \"no more supported\")\n}\ntype Query {\n deity(name: String! = \"Morpheus\"): Deity!\n}\n```\n\n\n```haskell\n{-# LANGUAGE DeriveGeneric #-}\n{-# LANGUAGE DuplicateRecordFields #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE MultiParamTypeClasses #-}\n{-# LANGUAGE NamedFieldPuns #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TemplateHaskell #-}\n{-# LANGUAGE TypeFamilies #-}\nmodule API (api) where\nimport Data.ByteString.Lazy.Char8 (ByteString)\nimport Data.Morpheus (interpreter)\nimport Data.Morpheus.Document (importGQLDocument)\nimport Data.Morpheus.Types (RootResolver (..), Undefined (..))\nimport Data.Text (Text)\nimportGQLDocument \"schema.gql\"\nrootResolver :: RootResolver IO () Query Undefined Undefined\nrootResolver =\n RootResolver\n { queryResolver = Query {deity},\n mutationResolver = Undefined,\n subscriptionResolver = Undefined\n }\n where\n deity DeityArgs {name} =\n pure\n Deity\n { name = pure name,\n power = pure (Just \"Shapeshifting\")\n }\napi :: ByteString -> IO ByteString\napi = interpreter rootResolver\n```\n\nSee [morpheus-graphql-examples](https://github.com/morpheusgraphql/morpheus-graphql) for more sophisticated APIs.\n",
+ "url": "https://github.com/morpheusgraphql/morpheus-graphql",
+ "github": "https://github.com/morpheusgraphql/morpheus-graphql"
+ }
+ ],
+ "GraphQL Clients": [
+ {
+ "name": "morpheus-graphql-client",
+ "description": "A strongly-typed GraphQL client implementation in Haksell.",
+ "url": "https://github.com/morpheusgraphql/morpheus-graphql",
+ "github": "https://github.com/morpheusgraphql/morpheus-graphql"
+ }
+ ]
+ },
+ "Java / Android": {
+ "Server Libraries": [
+ {
+ "name": "graphql-java",
+ "description": "A Java library for building GraphQL APIs.",
+ "howto": "Code that executes a hello world GraphQL query with `graphql-java`:\n\n```java\nimport graphql.ExecutionResult;\nimport graphql.GraphQL;\nimport graphql.schema.GraphQLSchema;\nimport graphql.schema.StaticDataFetcher;\nimport graphql.schema.idl.RuntimeWiring;\nimport graphql.schema.idl.SchemaGenerator;\nimport graphql.schema.idl.SchemaParser;\nimport graphql.schema.idl.TypeDefinitionRegistry;\n\nimport static graphql.schema.idl.RuntimeWiring.newRuntimeWiring;\n\npublic class HelloWorld {\n\n public static void main(String[] args) {\n String schema = \"type Query{hello: String} schema{query: Query}\";\n\n SchemaParser schemaParser = new SchemaParser();\n TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema);\n\n RuntimeWiring runtimeWiring = new RuntimeWiring()\n .type(\"Query\", builder -> builder.dataFetcher(\"hello\", new StaticDataFetcher(\"world\")))\n .build();\n\n SchemaGenerator schemaGenerator = new SchemaGenerator();\n GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(typeDefinitionRegistry, runtimeWiring);\n\n GraphQL build = GraphQL.newGraphQL(graphQLSchema).build();\n ExecutionResult executionResult = build.execute(\"{hello}\");\n\n System.out.println(executionResult.getData().toString());\n // Prints: {hello=world}\n }\n}\n```\n\nSee [the graphql-java docs](https://github.com/graphql-java/graphql-java) for more information on setup.\n",
+ "github": "graphql-java/graphql-java",
+ "url": "https://github.com/graphql-java/graphql-java"
+ }
+ ],
+ "GraphQL Clients": [
+ {
+ "name": "Apollo Android",
+ "description": "A strongly-typed, caching GraphQL client for Android, written in Java.",
+ "github": "apollographql/apollo-android",
+ "url": "https://github.com/apollographql/apollo-android"
+ },
+ {
+ "name": "Nodes",
+ "description": "A GraphQL JVM Client designed for constructing queries from standard model definitions. By American Express.",
+ "github": "americanexpress/nodes",
+ "url": "https://github.com/americanexpress/nodes"
+ }
+ ]
+ },
"JavaScript": {
+ "Server Libraries": [
+ {
+ "name": "GraphQL.js",
+ "description": "The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.",
+ "howto": "To run a `GraphQL.js` hello world script from the command line:\n\n```bash\nnpm install graphql\n```\n\nThen run `node hello.js` with this code in `hello.js`:\n\n```js\nvar { graphql, buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\ngraphql(schema, '{ hello }', root).then((response) => {\n console.log(response);\n});\n```",
+ "url": "/graphql-js/",
+ "npm": "graphql",
+ "github": "graphql/graphql-js"
+ },
+ {
+ "name": "Express GraphQL",
+ "description": "The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.",
+ "howto": "To run an `express-graphql` hello world server:\n\n```bash\nnpm install express express-graphql graphql\n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nvar express = require('express');\nvar { graphqlHTTP } = require('express-graphql');\nvar { buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\nvar app = express();\napp.use('/graphql', graphqlHTTP({\n schema: schema,\n rootValue: root,\n graphiql: true,\n}));\napp.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));\n```",
+ "url": "/graphql-js/running-an-express-graphql-server/",
+ "npm": "express-graphql",
+ "github": "graphql/express-graphql"
+ },
+ {
+ "name": "Apollo Server",
+ "description": "A set of GraphQL server packages from Apollo that work with various Node.js HTTP frameworks (Express, Connect, Hapi, Koa etc).",
+ "howto": "To run a hello world server with apollo-server-express:\n\n```bash\nnpm install apollo-server-express express \n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nconst express = require('express');\nconst { ApolloServer, gql } = require('apollo-server-express');\n\nconst typeDefs = gql`\n type Query {\n hello: String\n }\n`;\n\nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n\nconst server = new ApolloServer({ typeDefs, resolvers });\n\nconst app = express();\nserver.applyMiddleware({ app });\n\napp.listen({ port: 4000 }, () =>\n console.log('Now browse to http://localhost:4000' + server.graphqlPath)\n);\n```\n\nApollo Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI, Koa and NestJs.",
+ "url": "https://www.apollographql.com/docs/apollo-server/",
+ "npm": "apollo-server-express",
+ "github": "apollographql/apollo-server"
+ }
+ ],
"GraphQL Clients": [
{
"name": "Relay",
@@ -121,34 +363,153 @@
"npm": "graphqurl",
"github": "hasura/graphqurl"
}
- ],
- "Server Libraries": [
- {
- "name": "GraphQL.js",
- "description": "The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.",
- "howto": "To run a `GraphQL.js` hello world script from the command line:\n\n```bash\nnpm install graphql\n```\n\nThen run `node hello.js` with this code in `hello.js`:\n\n```js\nvar { graphql, buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\ngraphql(schema, '{ hello }', root).then((response) => {\n console.log(response);\n});\n```",
- "url": "/graphql-js/",
- "npm": "graphql",
- "github": "graphql/graphql-js"
- },
- {
- "name": "Express GraphQL",
- "description": "The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.",
- "howto": "To run an `express-graphql` hello world server:\n\n```bash\nnpm install express express-graphql graphql\n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nvar express = require('express');\nvar { graphqlHTTP } = require('express-graphql');\nvar { buildSchema } = require('graphql');\n\nvar schema = buildSchema(`\n type Query {\n hello: String\n }\n`);\n\nvar root = { hello: () => 'Hello world!' };\n\nvar app = express();\napp.use('/graphql', graphqlHTTP({\n schema: schema,\n rootValue: root,\n graphiql: true,\n}));\napp.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));\n```",
- "url": "/graphql-js/running-an-express-graphql-server/",
- "npm": "express-graphql",
- "github": "graphql/express-graphql"
- },
- {
- "name": "Apollo Server",
- "description": "A set of GraphQL server packages from Apollo that work with various Node.js HTTP frameworks (Express, Connect, Hapi, Koa etc).",
- "howto": "To run a hello world server with apollo-server-express:\n\n```bash\nnpm install apollo-server-express express \n```\n\nThen run `node server.js` with this code in `server.js`:\n\n```js\nconst express = require('express');\nconst { ApolloServer, gql } = require('apollo-server-express');\n\nconst typeDefs = gql`\n type Query {\n hello: String\n }\n`;\n\nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n\nconst server = new ApolloServer({ typeDefs, resolvers });\n\nconst app = express();\nserver.applyMiddleware({ app });\n\napp.listen({ port: 4000 }, () =>\n console.log('Now browse to http://localhost:4000' + server.graphqlPath)\n);\n```\n\nApollo Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI, Koa and NestJs.",
- "url": "https://www.apollographql.com/docs/apollo-server/",
- "npm": "apollo-server-express",
- "github": "apollographql/apollo-server"
- }
]
},
+ "Julia": {
+ "GraphQL Clients": [
+ {
+ "name": "Diana.jl",
+ "description": "A Julia GraphQL server implementation.",
+ "url": "https://github.com/codeneomatrix/Diana.jl",
+ "github": "codeneomatrix/Diana.jl"
+ }
+ ]
+ },
+ "Kotlin": {
+ "Server Libraries": [
+ {
+ "name": "graphql-kotlin",
+ "description": "A set of libraries for running GraphQL server in Kotlin.",
+ "url": "https://github.com/ExpediaGroup/graphql-kotlin/",
+ "github": "ExpediaGroup/graphql-kotlin"
+ }
+ ]
+ },
+ "Perl": {
+ "Server Libraries": [
+ {
+ "name": "graphql-perl",
+ "description": "A Perl port of GraphQL reference implementation",
+ "howto": "- [MetaCPAN documentation](https://metacpan.org/pod/GraphQL)\n\n - [Mojolicious-Plugin-GraphQL](https://github.com/graphql-perl/Mojolicious-Plugin-GraphQL) - connect your GraphQL service to a Mojolicious app\n\n - [GraphQL-Plugin-Convert-DBIC](https://github.com/graphql-perl/GraphQL-Plugin-Convert-DBIC) - automatically connect your DBIx::Class schema to GraphQL\n\n - [GraphQL-Plugin-Convert-OpenAPI](https://github.com/graphql-perl/GraphQL-Plugin-Convert-OpenAPI) - automatically connect any OpenAPI service (either local Mojolicious one, or remote) to GraphQL\n\n",
+ "url": "https://github.com/graphql-perl/graphql-perl",
+ "github": "graphql-perl/graphql-perl"
+ }
+ ]
+ },
+ "PHP": {
+ "Server Libraries": [
+ {
+ "name": "graphql-php",
+ "description": "A PHP port of GraphQL reference implementation",
+ "url": "https://github.com/webonyx/graphql-php",
+ "github": "webonyx/graphql-php"
+ },
+ {
+ "name": "graphql-relay-php",
+ "description": "A library to help construct a graphql-php server supporting react-relay.",
+ "url": "https://github.com/ivome/graphql-relay-php",
+ "github": "ivome/graphql-relay-php"
+ },
+ {
+ "name": "Railt",
+ "description": "A PHP GraphQL Framework.",
+ "url": "https://github.com/railt/railt",
+ "github": "railt/railt"
+ },
+ {
+ "name": "Lighthouse",
+ "description": "A GraphQL server for Laravel",
+ "url": "https://github.com/nuwave/lighthouse",
+ "github": "nuwave/lighthouse"
+ },
+ {
+ "name": "GraphQLBundle",
+ "description": "A GraphQL server for Symfony",
+ "url": "https://github.com/overblog/GraphQLBundle",
+ "github": "overblog/GraphQLBundle"
+ },
+ {
+ "name": "WPGraphQL",
+ "description": "A free, open-source WordPress plugin that provides an extendable GraphQL schema and API for any WordPress site ",
+ "github": "wp-graphql/wp-graphql",
+ "url": "https://github.com/wp-graphql/wp-graphql"
+ },
+ {
+ "name": "API Platform",
+ "description": "API Platform is a fully-featured, flexible and extensible API framework built on top of Symfony.",
+ "howto": "The following class is enough to create both a Relay-compatible GraphQL server and a hypermedia API supporting modern REST formats (JSON-LD, JSONAPI...):\n\n```php\nname;\n }\n // ...\n}\n```\nOther GraphQLite features include validation, security, error handling, loading via data-loader pattern...",
+ "github": "thecodingmachine/graphqlite",
+ "url": "https://graphqlite.thecodingmachine.io"
+ },
+ {
+ "name": "Siler",
+ "description": "Siler is a PHP library powered with high-level abstractions to work with GraphQL.",
+ "howto": "To run a Siler hello world script:\n```graphql\ntype Query {\n hello: String\n}\n```\n\n```php\n [\n 'hello' => 'world',\n ],\n];\n$schema = Graphqlschema($typeDefs, $resolvers);\n\necho \"Server running at http://127.0.0.1:8080\";\n\nHttpserver(Graphqlpsr7($schema), function (Throwable $err) {\n var_dump($err);\n return Diactorosjson([\n 'error' => true,\n 'message' => $err->getMessage(),\n ]);\n})()->run();\n```\nIt also provides functionality for the construction of a WebSocket Subscriptions Server based on how Apollo works.\n",
+ "github": "leocavalcante/siler",
+ "url": "https://siler.leocavalcante.com/graphql/"
+ },
+ {
+ "name": "GraphQL API for WordPress",
+ "description": "A GraphQL server for WordPress",
+ "github": "https://github.com/GraphQLAPI/graphql-api-for-wp",
+ "url": "https://github.com/GraphQLAPI/graphql-api-for-wp"
+ },
+ {
+ "name": "GraPHPinator",
+ "description": "A GraphQL implementation for modern PHP",
+ "github": "https://github.com/infinityloop-dev/graphpinator",
+ "url": "https://github.com/infinityloop-dev/graphpinator"
+ }
+ ]
+ },
+ "Python": {
+ "Server Libraries": [
+ {
+ "name": "Graphene",
+ "description": "A Python library for building GraphQL APIs.",
+ "howto": "To run a Graphene hello world script:\n\n```bash\npip install graphene\n```\n\nThen run `python hello.py` with this code in `hello.py`:\n\n```python\nimport graphene\n\nclass Query(graphene.ObjectType):\n hello = graphene.String(name=graphene.String(default_value=\"World\"))\n\n def resolve_hello(self, info, name):\n return 'Hello ' + name\n\nschema = graphene.Schema(query=Query)\nresult = schema.execute('{ hello }')\nprint(result.data['hello']) # \"Hello World\"\n```\n\nThere are also nice bindings for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine.",
+ "url": "http://graphene-python.org/",
+ "github": "graphql-python/graphene"
+ }
+ ],
+ "GraphQL Clients": [
+ {
+ "name": "GQL",
+ "description": "A GraphQL client in Python.",
+ "url": "https://github.com/graphql-python/gql",
+ "github": "graphql-python/gql"
+ },
+ {
+ "name": "python-graphql-client",
+ "description": "Simple GraphQL client for Python 2.7+.",
+ "github": "prisma-labs/python-graphql-client",
+ "url": "https://github.com/prisma/python-graphql-client"
+ },
+ {
+ "name": "sgqlc",
+ "description": "A simple Python GraphQL client. Supports generating code generation for types defined in a GraphQL schema.",
+ "github": "profusion/sgqlc",
+ "url": "https://github.com/profusion/sgqlc"
+ }
+ ]
+ },
+ "R": {
+ "Server Libraries": [
+ {
+ "name": "ghql",
+ "description": "General purpose GraphQL R client",
+ "github": "ropensci/ghql",
+ "url": "https://github.com/ropensci/ghql"
+ }
+ ]
+ },
"Ruby": {
"Server Libraries": [
{
@@ -167,6 +528,67 @@
"github": "ohler55/agoo"
}
]
+ },
+ "Rust": {
+ "Server Libraries": [
+ {
+ "name": "graphql-rust/juniper",
+ "description": "GraphQL server library for Rust",
+ "github": "graphql-rust/juniper",
+ "url": "https://github.com/graphql-rust/juniper"
+ }
+ ]
+ },
+ "Scala": {
+ "Server Libraries": [
+ {
+ "name": "Sangria",
+ "description": "A Scala GraphQL library that supports [Relay](https://facebook.github.io/relay/).",
+ "howto": "An example of a hello world GraphQL schema and query with `sangria`:\n```scala\nimport sangria.schema._\nimport sangria.execution._\nimport sangria.macros._\n\nval QueryType = ObjectType(\"Query\", fields[Unit, Unit](\n Field(\"hello\", StringType, resolve = _ ⇒ \"Hello world!\")\n))\n\nval schema = Schema(QueryType)\n\nval query = graphql\"{ hello }\"\n\nExecutor.execute(schema, query) map println\n```",
+ "url": "http://sangria-graphql.org/",
+ "github": "sangria-graphql/sangria"
+ }
+ ]
+ },
+ "OCaml / Reason": {
+ "Server Libraries": [
+ {
+ "name": "ocaml-graphql-server",
+ "description": "GraphQL server library for OCaml and Reason",
+ "url": "https://github.com/andreas/ocaml-graphql-server",
+ "github": "andreas/ocaml-graphql-server"
+ }
+ ]
+ },
+ "Swift / Objective-C iOS": {
+ "Server Libraries": [
+ {
+ "name": "Graphiti",
+ "description": "Swift library for building GraphQL schemas/types fast, safely and easily.",
+ "url": "https://github.com/GraphQLSwift/Graphiti",
+ "github": "GraphQLSwift/Graphiti"
+ }
+ ],
+ "GraphQL Clients": [
+ {
+ "name": "Apollo iOS",
+ "description": "A GraphQL client for iOS that returns results as query-specific Swift types, and integrates with Xcode to show your Swift source and GraphQL side by side, with inline validation errors.",
+ "url": "https://www.apollographql.com/docs/ios/",
+ "github": "apollographql/apollo-ios"
+ },
+ {
+ "name": "GraphQL iOS",
+ "description": "An Objective-C GraphQL client for iOS.",
+ "url": "https://github.com/funcompany/graphql-ios",
+ "github": "funcompany/graphql-ios"
+ },
+ {
+ "name": "Graphaello",
+ "description": "A Tool for Writing Declarative, Type-Safe and Data-Driven Applications in SwiftUI using GraphQL and Apollo",
+ "github": "nerdsupremacist/Graphaello",
+ "url": "https://github.com/nerdsupremacist/Graphaello"
+ }
+ ]
}
},
"Tools": [
@@ -267,5 +689,54 @@
"npm": "sofa-api",
"github": "Urigo/SOFA"
}
+ ],
+ "Services": [
+ {
+ "name": "Apollo Graph Manager",
+ "description": "A cloud service for monitoring the performance and usage of your GraphQL backend.",
+ "url": "https://engine.apollographql.com"
+ },
+ {
+ "name": "GraphCMS",
+ "description": "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.",
+ "url": "https://graphcms.com/"
+ },
+ {
+ "name": "Prisma",
+ "description": "([github](https://github.com/prisma)) 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.",
+ "url": "https://www.prisma.io"
+ },
+ {
+ "name": "Tipe",
+ "description": "([github](https://github.com/tipeio)) A SaaS (Software as a Service) content management system that allows you to create your content with powerful editing tools and access it from anywhere with a GraphQL or REST API.",
+ "url": "https://tipe.io"
+ },
+ {
+ "name": "AWS AppSync",
+ "description": "Fully managed GraphQL service with realtime subscriptions, offline programming & synchronization, and enterprise security features as well as fine grained authorization controls.",
+ "url": "https://aws.amazon.com/appsync/"
+ },
+ {
+ "name": "Elide",
+ "description": "A Java library that can expose a JPA annotated data model as a GraphQL service over any relational database.",
+ "url": "https://elide.io"
+ },
+ {
+ "name": "Hasura",
+ "description": "([github](https://github.com/hasura)) Hasura connects to your databases & microservices and instantly gives you a production-ready GraphQL API.",
+ "url": "https://hasura.io"
+ },
+ {
+ "name": "FaunaDB",
+ "description": "Create an instant GraphQL backend by importing a gql schema. The database will create relations and indexes for you, so you'll be ready to query in seconds, without writing any database code. Serverless pricing, free to get started.",
+ "url": "https://docs.fauna.com/fauna/current/graphql"
+ }
+ ],
+ "More Stuff": [
+ {
+ "name": "awesome-graphql",
+ "description": "A fantastic community maintained collection of libraries, resources, and more.",
+ "url": "https://github.com/chentsulin/awesome-graphql"
+ }
]
}
\ No newline at end of file
diff --git a/gatsby-node.js b/gatsby-node.js
index 177f44f490..9c635cf8ad 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -10,25 +10,25 @@ exports.onCreatePage = async ({ page, actions }) => {
sourcePath: path.relative(__dirname, page.componentPath),
}
if (page.path === "/code" || page.path === "/code/") {
- const [jsGraphQLClients, jsServerLibraries, rubyServerLibraries, tools] = await Promise.all([
- sortLibs(
- JSON.parse(readFileSync("./data/js-graphql-clients.json", "utf8"))
- ),
- sortLibs(
- JSON.parse(readFileSync("./data/js-server-libraries.json", "utf8"))
- ),
- sortLibs(
- JSON.parse(readFileSync("./data/ruby-server-libraries.json", "utf8"))
- ),
- sortLibs(JSON.parse(readFileSync("./data/tools.json", "utf8"))),
+ const codeData = JSON.parse(readFileSync("./data/code.json", "utf8"));
+ await Promise.all([
+ Promise.all(Object.keys(codeData.Libraries).map(async languageName => {
+ const libraryCategoryMap = codeData.Libraries[languageName];
+ await Promise.all(
+ Object.keys(libraryCategoryMap).map(async libraryCategoryName => {
+ const libraries = libraryCategoryMap[libraryCategoryName]
+ libraryCategoryMap[libraryCategoryName] = await sortLibs(libraries)
+ })
+ )
+ })),
+ sortLibs(codeData.Tools).then(sortedTools => {
+ codeData.Tools = sortedTools;
+ }),
])
context = {
...context,
- jsGraphQLClients,
- jsServerLibraries,
- rubyServerLibraries,
- tools,
+ codeData,
}
}
createPage({
diff --git a/scripts/sort-libraries.js b/scripts/sort-libraries.js
index 46d392b6db..ef63664a6c 100644
--- a/scripts/sort-libraries.js
+++ b/scripts/sort-libraries.js
@@ -2,9 +2,9 @@ const fetch = require(`node-fetch`)
const getGitHubStats = async githubRepo => {
const [owner, repoName] = githubRepo.split("/")
- const accessToken = process.env.GITHUB_ACCESS_TOKEN;
+ const accessToken = process.env.GITHUB_ACCESS_TOKEN
if (!accessToken) {
- throw new Error(`You must have GITHUB_ACCESS_TOKEN env variable defined!`);
+ throw new Error(`You must have GITHUB_ACCESS_TOKEN env variable defined!`)
}
const query = /* GraphQL */ `
fragment defaultBranchRef on Ref {
@@ -35,6 +35,9 @@ const getGitHubStats = async githubRepo => {
masterRef: ref(qualifiedName: "master") {
...defaultBranchRef
}
+ developRef: ref(qualifiedName: "develop") {
+ ...defaultBranchRef
+ }
stargazers {
totalCount
}
@@ -48,8 +51,8 @@ const getGitHubStats = async githubRepo => {
}
}
`
- const lastMonth = new Date();
- lastMonth.setMonth(lastMonth.getMonth() - 1);
+ const lastMonth = new Date()
+ lastMonth.setMonth(lastMonth.getMonth() - 1)
const response = await fetch("https://api.github.com/graphql", {
method: "POST",
body: JSON.stringify({
@@ -62,11 +65,26 @@ const getGitHubStats = async githubRepo => {
},
})
const responseJson = await response.json()
- const repo = responseJson.data.repositoryOwner.repository
+ if (!responseJson?.data) {
+ throw `GitHub returned empty response for ${owner}/${repoName}`
+ }
+ const { repositoryOwner } = responseJson.data
+ if (!repositoryOwner) {
+ throw `No GitHub user found for ${owner}/${repoName}`
+ }
+ const { repository: repo } = repositoryOwner
+ if (!repo) {
+ throw `No GitHub repo found ${owner}/${repoName}`
+ }
const stars = repo.stargazers.totalCount
- const commitHistory = (repo.mainRef || repo.sourceRef || repo.masterRef)
- .target.history.edges
- let commitCount = 0, daysWithCommitSet = new Set(), finalUpdatedTime;
+ const actualDefaultBranch =
+ repo.mainRef || repo.sourceRef || repo.developRef || repo.masterRef
+ if (!actualDefaultBranch) {
+ throw `No default branch found for ${owner}/${repoName}`
+ }
+ const commitHistory = actualDefaultBranch.target.history.edges
+ let commitCount = 0,
+ daysWithCommitSet = new Set()
commitHistory.forEach(commit => {
if (!commit.node.author.name.match(/bot/i)) {
commitCount++
@@ -92,16 +110,21 @@ const getNpmStats = async packageName => {
}
const getGemStats = async packageName => {
- const response = await fetch(`https://rubygems.org/api/v1/gems/${encodeURIComponent(packageName)}.json`);
+ const response = await fetch(
+ `https://rubygems.org/api/v1/gems/${encodeURIComponent(packageName)}.json`
+ )
const responseJson = await response.json()
const downloadCount = responseJson.downloads
return { downloadCount }
}
const sortLibs = async libs => {
+ if (libs.length === 1) {
+ return libs;
+ }
const libsWithScores = await Promise.all(
libs.map(async lib => {
- const [npmStats = {}, githubStats = {}] = await Promise.all([
+ const [npmStats = {}, gemStars = {}, githubStats = {}] = await Promise.all([
lib.npm && getNpmStats(lib.npm),
lib.gem && getGemStats(lib.gem),
lib.github && getGitHubStats(lib.github),
@@ -118,9 +141,9 @@ const sortLibs = async libs => {
bScore = 0
if (a.npm && b.npm) {
if (a.downloadCount > b.downloadCount) {
- aScore += 40;
+ aScore += 40
} else if (b.downloadCount > a.downloadCount) {
- bScore += 40;
+ bScore += 40
}
}
if (a.github && b.github) {
@@ -130,14 +153,14 @@ const sortLibs = async libs => {
bScore += 20
}
if (a.commitCount > b.commitCount) {
- aScore += 20;
+ aScore += 20
} else if (a.commitCount < b.commitCount) {
- bScore += 20;
+ bScore += 20
}
if (a.stars > b.stars) {
- aScore += 30;
+ aScore += 30
} else if (a.stars < b.stars) {
- bScore += 30;
+ bScore += 30
}
}
if (bScore > aScore) {
diff --git a/src/pages/code.tsx b/src/pages/code.tsx
index 0b89384e96..df982e4f76 100644
--- a/src/pages/code.tsx
+++ b/src/pages/code.tsx
@@ -1,6 +1,115 @@
import React from "react"
import Layout from "../components/Layout"
import Marked from "../components/Marked"
+import { toSlug } from "../utils/slug"
+
+export function buildLanguagesMenu(pageContext: any) {
+ let lastRow: string[]
+ const rows: string[][] = []
+ Object.keys(pageContext.codeData.Libraries).forEach((languageName, index) => {
+ if (index % 5 === 0) {
+ lastRow = []
+ rows.push(lastRow)
+ } else {
+ lastRow.push(languageName)
+ }
+ })
+ return (
+
}
export default ({ pageContext }: any) => {
@@ -132,12 +191,12 @@ export default ({ pageContext }: any) => {
Because GraphQL is a communication pattern, there are many tools
to help you get started working which support GraphQL in all
sorts of languages.
- {" "}
+
From 99aedfa397f7d71a38d8edcacac3a3a282e4c717 Mon Sep 17 00:00:00 2001
From: Arda TANRIKULU
Date: Tue, 17 Nov 2020 18:56:20 +0300
Subject: [PATCH 033/439] Small fixes
---
.../code/language-support/groovy/server/gorm-graphql.md | 4 ++--
src/content/code/language-support/ruby/server/agoo.md | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/content/code/language-support/groovy/server/gorm-graphql.md b/src/content/code/language-support/groovy/server/gorm-graphql.md
index a8aaae05fd..9c6ba9c890 100644
--- a/src/content/code/language-support/groovy/server/gorm-graphql.md
+++ b/src/content/code/language-support/groovy/server/gorm-graphql.md
@@ -1,7 +1,7 @@
---
name: gorm-graphql
-description: undefined
-url: https://github.com/grails/gorm-graphql/
+description: An automatic GraphQL schema generator for GORM
+url: https://grails.github.io/gorm-graphql/latest/guide/index.html
github: grails/gorm-graphql
---
diff --git a/src/content/code/language-support/ruby/server/agoo.md b/src/content/code/language-support/ruby/server/agoo.md
index 1f69c728a9..be7b315dd5 100644
--- a/src/content/code/language-support/ruby/server/agoo.md
+++ b/src/content/code/language-support/ruby/server/agoo.md
@@ -1,7 +1,7 @@
---
name: Agoo
description: A high performance web server with support for GraphQL. Agoo strives for a simple, easy to use API for GraphQL.
-url: undefined
+url: https://github.com/ohler55/agoo
github: ohler55/agoo
gem: agoo
---
From c7883c9db239c5232024e83bc18469d33d0e1940 Mon Sep 17 00:00:00 2001
From: Patrick Arminio
Date: Wed, 18 Nov 2020 14:32:37 +0000
Subject: [PATCH 034/439] Add strawberry as a Python library
---
.../python/server/strawberry.md | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 src/content/code/language-support/python/server/strawberry.md
diff --git a/src/content/code/language-support/python/server/strawberry.md b/src/content/code/language-support/python/server/strawberry.md
new file mode 100644
index 0000000000..b12260ed80
--- /dev/null
+++ b/src/content/code/language-support/python/server/strawberry.md
@@ -0,0 +1,32 @@
+---
+name: Strawberry
+description: Strawberry is a Python library for implementing code first GraphQL servers using modern Python features like type hints.
+url: https://strawberry.rocks
+github: strawberry-graphql/strawberry
+---
+
+Here's an example of a Strawberry hello world, first install the library:
+
+```bash
+pip install strawberry-graphql
+```
+
+Create an `app.py` file with this content:
+
+```python
+import strawberry
+
+@strawberry.type
+class Query:
+ @strawberry.field
+ def hello(self, name: str = "World") -> str:
+ return f"Hello {name}"
+
+schema = strawberry.Schema(query=Query)
+```
+
+Then run `strawberry server app` and you will have a basic schema server
+running on `http://localhost:8000/`.
+
+Strawberry also has views for ASGI, Flask and Django and provides utilities
+like dataloaders and tracing.
From 475b842eabbf9aa1dae8a82b1e951fefb33bcbce Mon Sep 17 00:00:00 2001
From: Orta Therox
Date: Wed, 18 Nov 2020 09:43:00 -0500
Subject: [PATCH 035/439] Docs for the code page & CI
---
.github/workflows/CI.yml | 18 ++++++++
notes/ContributingToCodePage.md | 78 +++++++++++++++++++++++++++++++++
src/pages/code.tsx | 1 +
3 files changed, 97 insertions(+)
create mode 100644 .github/workflows/CI.yml
create mode 100644 notes/ContributingToCodePage.md
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
new file mode 100644
index 0000000000..5139ea6a2e
--- /dev/null
+++ b/.github/workflows/CI.yml
@@ -0,0 +1,18 @@
+name: CI
+on: pull_request
+
+jobs:
+ tests:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v1
+
+ - run: yarn install
+
+ # Verify it compiles
+ - run: yarn build
+
+ # Doesn't pass ATM
+ # - run: yarn tsc --noEmit
diff --git a/notes/ContributingToCodePage.md b/notes/ContributingToCodePage.md
new file mode 100644
index 0000000000..2ac02d4479
--- /dev/null
+++ b/notes/ContributingToCodePage.md
@@ -0,0 +1,78 @@
+## Contributing to the Code Page
+
+Hi, thanks for reading the docs!
+
+Secondly, we want to provide a really strong overview of all the libraries in the GraphQL eco-system. To make this
+easy for contributors the code page is automatically generated from a series of markdown files in this repo.
+
+```sh
+$ tree src/content/code
+src/content/code
+├── language-support
+│ ├── c-c
+│ │ └── tools
+│ │ └── libgraphqlparser.md
+│ ├── clojure
+│ │ ├── client
+│ │ │ └── regraph.md
+│ │ └── server
+│ │ ├── alumbra.md
+│ │ ├── graphql-clj.md
+│ │ └── lacinia.md
+│ ├── c-net
+│ │ ├── client
+│ │ │ ├── graphql-client.md
+│ │ │ ├── graphql-net-client.md
+│ │ │ └── sahb-graphqlclient.md
+// etc
+```
+
+We'd love any new project to include a few paragraphs describing its goals and usage, the goal here is to make it easy for people to decide between options.
+
+Here's an optimal example example of what we're looking for:
+
+- It uses yml frontmatter to provide additional information like repo, npm
+- It explains itself in the 'description' then fills fleshes out that description with some code samples
+
+````md
+---
+name: Express GraphQL
+description: The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.
+url: /graphql-js/running-an-express-graphql-server/
+github: graphql/express-graphql
+npm: "express-graphql"
+---
+
+To run an `express-graphql` hello world server:
+
+```bash
+npm install express express-graphql graphql
+```
+
+Then run `node server.js` with this code in `server.js`:
+
+```js
+var express = require('express');
+var { graphqlHTTP } = require('express-graphql');
+var { buildSchema } = require('graphql');
+
+var schema = buildSchema(`
+ type Query {
+ hello: String
+ }
+`);
+
+var root = { hello: () => 'Hello world!' };
+
+var app = express();
+app.use('/graphql', graphqlHTTP({
+ schema: schema,
+ rootValue: root,
+ graphiql: true,
+}));
+app.listen(4000, () => console.log('Now browse to localhost:4000/graphql'));
+```
+
+````
+
+Any library/tool/service has a maximum height in the site, and then it can be expanded by clicking, so if you need quite a lot of space to explain your project then that's OK.
diff --git a/src/pages/code.tsx b/src/pages/code.tsx
index 0e3ae0a916..1b9e0ca9c0 100644
--- a/src/pages/code.tsx
+++ b/src/pages/code.tsx
@@ -251,6 +251,7 @@ export default ({ pageContext }: any) => {
{buildLibraryList(pageContext.otherLibraries.Services, pageContext)}
)
From b862ff0de0789a47640c1b22c3630c02fc2f49f8 Mon Sep 17 00:00:00 2001
From: Reid Mewborne
Date: Wed, 18 Nov 2020 11:35:30 -0500
Subject: [PATCH 036/439] moved caliban to scala
---
.../swift-objective-c-ios/client/caliban.md | 8 -----
.../swift-objective-c-ios/server/caliban.md | 36 -------------------
2 files changed, 44 deletions(-)
delete mode 100644 src/content/code/language-support/swift-objective-c-ios/client/caliban.md
delete mode 100644 src/content/code/language-support/swift-objective-c-ios/server/caliban.md
diff --git a/src/content/code/language-support/swift-objective-c-ios/client/caliban.md b/src/content/code/language-support/swift-objective-c-ios/client/caliban.md
deleted file mode 100644
index 881e35a0d5..0000000000
--- a/src/content/code/language-support/swift-objective-c-ios/client/caliban.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: Caliban
-description: Functional GraphQL library for Scala, with client code generation and type-safe queries.
-url: https://ghostdogpr.github.io/caliban/
-github: ghostdogpr/caliban
----
-
-
diff --git a/src/content/code/language-support/swift-objective-c-ios/server/caliban.md b/src/content/code/language-support/swift-objective-c-ios/server/caliban.md
deleted file mode 100644
index 71722002a1..0000000000
--- a/src/content/code/language-support/swift-objective-c-ios/server/caliban.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-name: Caliban
-description: Caliban is a purely functional library for building GraphQL servers and clients in Scala
-url: https://ghostdogpr.github.io/caliban/
-github: ghostdogpr/caliban
----
-
-An example of a GraphQL schema and query with `caliban`:
-```scala
-case class Character(name: String, age: Int)
-def getCharacters(): List[Character] = ???
-def getCharacter(name: String): Option[Character] = ???
-// schema
-case class CharacterName(name: String)
-case class Queries(characters: List[Character],
- character: CharacterName => Option[Character])
-// resolver
-val queries = Queries(getCharacters, args => getCharacter(args.name))
-import caliban.GraphQL.graphQL
-import caliban.RootResolver
-val api = graphQL(RootResolver(queries))
-for {
- interpreter <- api.interpreter
-} yield interpreter
-case class GraphQLResponse[+E](data: ResponseValue, errors: List[E])
-val query = """
- {
- characters {
- name
- }
- }"""
-for {
- result <- interpreter.execute(query)
- _ <- zio.console.putStrLn(result.data.toString)
-} yield ()
-```
From fbefe3f3748f1b98af1741fd7c353a9a7d2515b8 Mon Sep 17 00:00:00 2001
From: Reid Mewborne
Date: Wed, 18 Nov 2020 11:38:23 -0500
Subject: [PATCH 037/439] moved caliban to scala
---
.../language-support/scala/client/caliban.md | 8 +++++
.../language-support/scala/server/caliban.md | 33 +++++++++++++++++++
2 files changed, 41 insertions(+)
create mode 100644 src/content/code/language-support/scala/client/caliban.md
create mode 100644 src/content/code/language-support/scala/server/caliban.md
diff --git a/src/content/code/language-support/scala/client/caliban.md b/src/content/code/language-support/scala/client/caliban.md
new file mode 100644
index 0000000000..881e35a0d5
--- /dev/null
+++ b/src/content/code/language-support/scala/client/caliban.md
@@ -0,0 +1,8 @@
+---
+name: Caliban
+description: Functional GraphQL library for Scala, with client code generation and type-safe queries.
+url: https://ghostdogpr.github.io/caliban/
+github: ghostdogpr/caliban
+---
+
+
diff --git a/src/content/code/language-support/scala/server/caliban.md b/src/content/code/language-support/scala/server/caliban.md
new file mode 100644
index 0000000000..9a8bfe0f87
--- /dev/null
+++ b/src/content/code/language-support/scala/server/caliban.md
@@ -0,0 +1,33 @@
+---
+name: Caliban
+description: Caliban is a purely functional library for building GraphQL servers and clients in Scala
+url: https://ghostdogpr.github.io/caliban/
+github: ghostdogpr/caliban
+---
+
+An example of a GraphQL schema and query with `caliban`:
+```scala
+case class Character(name: String, age: Int)
+def getCharacters(): List[Character] = ???
+// schema
+case class Queries(characters: List[Character])
+// resolver
+val queries = Queries(getCharacters)
+import caliban.GraphQL.graphQL
+import caliban.RootResolver
+val api = graphQL(RootResolver(queries))
+for {
+ interpreter <- api.interpreter
+} yield interpreter
+case class GraphQLResponse[+E](data: ResponseValue, errors: List[E])
+val query = """
+ {
+ characters {
+ name
+ }
+ }"""
+for {
+ result <- interpreter.execute(query)
+ _ <- zio.console.putStrLn(result.data.toString)
+} yield ()
+```
From 70c26cf36e919b94a3a8640ec9f5b47e4b49feee Mon Sep 17 00:00:00 2001
From: Dariusz Kuc
Date: Wed, 18 Nov 2020 12:20:06 -0600
Subject: [PATCH 038/439] update documentation on graphql-kotlin
Add documentation on `graphql-kotlin` (https://github.com/ExpediaGroup/graphql-kotlin) usage for creating reactive GraphQL server and http client.
---
.../client/graphql-kotlin.md | 88 +++++++++++++++++++
.../server/graphql-kotlin.md | 34 ++++++-
2 files changed, 121 insertions(+), 1 deletion(-)
create mode 100644 src/content/code/language-support/java-kotlin-android/client/graphql-kotlin.md
diff --git a/src/content/code/language-support/java-kotlin-android/client/graphql-kotlin.md b/src/content/code/language-support/java-kotlin-android/client/graphql-kotlin.md
new file mode 100644
index 0000000000..94bf273a58
--- /dev/null
+++ b/src/content/code/language-support/java-kotlin-android/client/graphql-kotlin.md
@@ -0,0 +1,88 @@
+---
+name: graphql-kotlin
+description: A set of libraries for running GraphQL client and server in Kotlin.
+url: https://github.com/ExpediaGroup/graphql-kotlin/
+github: ExpediaGroup/graphql-kotlin
+---
+
+GraphQL Kotlin provides a set of lightweight type-safe GraphQL HTTP clients. The library provides Ktor HTTP client and Spring WebClient based reference implementations as well as allows for custom implementations using other engines. Type-safe data models are generated at build time by the GraphQL Kotlin Gradle and Maven plugins.
+
+To generate Ktor based GraphQL client add following to your Gradle build file:
+
+```kotlin
+// build.gradle.kts
+import com.expediagroup.graphql.plugin.generator.GraphQLClientType
+import com.expediagroup.graphql.plugin.gradle.graphql
+
+plugins {
+ id("com.expediagroup.graphql") version $latestGraphQLKotlinVersion
+}
+
+dependencies {
+ implementation("com.expediagroup:graphql-kotlin-ktor-client:$latestGraphQLKotlinVersion")
+}
+
+graphql {
+ client {
+ // target GraphQL endpoint
+ endpoint = "http://localhost:8080/graphql"
+ // package for generated client code
+ packageName = "com.example.generated"
+ clientType = GraphQLClientType.KTOR
+ }
+}
+```
+
+By default, GraphQL Kotlin plugin will look for query files under `src/main/resources`. Given `helloWorld: String!` query we can add following `HelloWorldQuery.graphql` sample query to our repo:
+
+```graphql
+query HelloWorldQuery {
+ helloWorld
+}
+```
+
+Plugin will generate following client code:
+
+```kotlin
+package com.example.generated
+
+import com.expediagroup.graphql.client.GraphQLKtorClient
+import com.expediagroup.graphql.types.GraphQLResponse
+import kotlin.String
+
+const val HELLO_WORLD_QUERY: String = "query HelloWorldQuery {\n helloWorld\n}"
+
+class HelloWorldQuery(
+ private val graphQLClient: GraphQLKtorClient<*>
+) {
+ suspend fun execute(requestBuilder: HttpRequestBuilder.() -> Unit = {}): GraphQLResponse =
+ graphQLClient.execute(HELLO_WORLD_QUERY, "HelloWorldQuery", null, requestBuilder)
+
+ data class Result(
+ val helloWorld: String
+ )
+}
+```
+
+We can then execute the client
+
+```kotlin
+package com.example.client
+
+import com.expediagroup.graphql.client.GraphQLKtorClient
+import com.expediagroup.graphql.generated.HelloWorldQuery
+import kotlinx.coroutines.runBlocking
+import java.net.URL
+
+fun main() {
+ val client = GraphQLKtorClient(url = URL("http://localhost:8080/graphql"))
+ val helloWorldQuery = HelloWorldQuery(client)
+ runBlocking {
+ val result = helloWorldQuery.execute()
+ println("hello world query result: ${result.data?.helloWorld}")
+ }
+ client.close()
+}
+```
+
+See [graphql-kotlin docs](https://expediagroup.github.io/graphql-kotlin/docs/getting-started) for additial details.
\ No newline at end of file
diff --git a/src/content/code/language-support/java-kotlin-android/server/graphql-kotlin.md b/src/content/code/language-support/java-kotlin-android/server/graphql-kotlin.md
index d2ac52b9b2..9e321f89a7 100644
--- a/src/content/code/language-support/java-kotlin-android/server/graphql-kotlin.md
+++ b/src/content/code/language-support/java-kotlin-android/server/graphql-kotlin.md
@@ -1,8 +1,40 @@
---
name: graphql-kotlin
-description: A set of libraries for running GraphQL server in Kotlin.
+description: A set of libraries for running GraphQL client and server in Kotlin.
url: https://github.com/ExpediaGroup/graphql-kotlin/
github: ExpediaGroup/graphql-kotlin
---
+GraphQL Kotlin follows a code first approach for generating your GraphQL schemas. Given the similarities between Kotlin and GraphQL, such as the ability to define nullable/non-nullable types, a schema can be generated from Kotlin code without any separate schema specification. To create a reactive GraphQL web server add following dependency to your Gradle build file:
+```kotlin
+// build.gradle.kts
+implementation("com.expediagroup", "graphql-kotlin-spring-server", latestVersion)
+```
+
+We also need to provide a list of supported packages that can be scanned for exposing your schema objects through reflections. Add following configuration to your `application.yml` file:
+
+```yaml
+graphql:
+ packages:
+ - "com.your.package"
+```
+
+With the above configuration we can now create our schema. In order to expose your queries, mutations and/or subscriptions in the GraphQL schema you simply need to implement corresponding marker interface and they will be automatically picked up by `graphql-kotlin-spring-server` auto-configuration library.
+
+```kotlin
+@Component
+class HelloWorldQuery : Query {
+ fun helloWorld() = "Hello World!!!"
+}
+```
+
+This will result in a reactive GraphQL web application with following schema:
+
+```graphql
+type Query {
+ helloWorld: String!
+}
+```
+
+See [graphql-kotlin docs](https://expediagroup.github.io/graphql-kotlin/docs/getting-started) for additial details.
From b7c576e0e2ed08cc44f36423708ecbac7e19fc60 Mon Sep 17 00:00:00 2001
From: Michael Esteban
Date: Thu, 19 Nov 2020 22:30:38 +1000
Subject: [PATCH 039/439] Include code of conduct directory in create page
process (#967)
---
gatsby-node.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gatsby-node.js b/gatsby-node.js
index 4b08795d35..fc7bf4e0f2 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -172,7 +172,7 @@ exports.createPages = async ({ graphql, actions }) => {
if (
sourceInstanceName !== "content" ||
- relativeDirectory.includes("code")
+ relativeDirectory.includes("code/")
) {
return
}
From d19e4b44fc7e4e4ecdefc667a2779359c552b4ce Mon Sep 17 00:00:00 2001
From: Phil Pluckthun
Date: Thu, 19 Nov 2020 21:17:35 +0000
Subject: [PATCH 040/439] Update documentation for urql (#969)
* Update urql's description and metadata
* Add descriptions as seen for graphql-yoga et al
* Replace "The" with "A"
In our tagline we use "The" on our own pages, and "A" on external
documentation.
---
.../code/language-support/javascript/client/urql.md | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/content/code/language-support/javascript/client/urql.md b/src/content/code/language-support/javascript/client/urql.md
index 2dcc709cc5..801836bea7 100644
--- a/src/content/code/language-support/javascript/client/urql.md
+++ b/src/content/code/language-support/javascript/client/urql.md
@@ -1,9 +1,15 @@
---
name: urql
-description: A highly customizable and versatile GraphQL client for React.
-url: https://formidable.com/open-source/urql/
+description: A highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
+url: https://formidable.com/open-source/urql/docs/
github: FormidableLabs/urql
-npm: "urql"
+npm: "@urql/core"
---
+`urql` is a GraphQL client that exposes a set of helpers for several frameworks.
+It's built to be highly customisable and versatile so you can take it from getting started with your first GraphQL project
+all the way to building complex apps and experimenting with GraphQL clients.
+- Currently supports React, React Native, Preact, Svelte, and Vue, and is supported by GraphQL Code Generator.
+- Logical yet simple default behaviour and document caching, and normalized caching via `@urql/exchange-graphcache`
+- Fully customizable behaviour via "exchanges" (addon packages)
From ef62c431834c709018cc9a09175b1ef2eba2071a Mon Sep 17 00:00:00 2001
From: Pierre Ricadat
Date: Fri, 20 Nov 2020 16:40:34 +0900
Subject: [PATCH 041/439] Simplify Caliban example and make it more readable
---
.../language-support/scala/server/caliban.md | 26 ++++++++-----------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/content/code/language-support/scala/server/caliban.md b/src/content/code/language-support/scala/server/caliban.md
index 9a8bfe0f87..2319f7f4bb 100644
--- a/src/content/code/language-support/scala/server/caliban.md
+++ b/src/content/code/language-support/scala/server/caliban.md
@@ -7,27 +7,23 @@ github: ghostdogpr/caliban
An example of a GraphQL schema and query with `caliban`:
```scala
+import caliban.GraphQL.graphQL
+import caliban.RootResolver
+
case class Character(name: String, age: Int)
+
def getCharacters(): List[Character] = ???
+
// schema
case class Queries(characters: List[Character])
+
// resolver
val queries = Queries(getCharacters)
-import caliban.GraphQL.graphQL
-import caliban.RootResolver
-val api = graphQL(RootResolver(queries))
+
+val query = "{ characters { name } }"
for {
+ api = graphQL(RootResolver(queries))
interpreter <- api.interpreter
-} yield interpreter
-case class GraphQLResponse[+E](data: ResponseValue, errors: List[E])
-val query = """
- {
- characters {
- name
- }
- }"""
-for {
- result <- interpreter.execute(query)
- _ <- zio.console.putStrLn(result.data.toString)
-} yield ()
+ result <- interpreter.execute(query)
+} yield result
```
From 0b330c6c8aba003ea75c8bc4f29fc56ca4061d20 Mon Sep 17 00:00:00 2001
From: Pierre Ricadat
Date: Fri, 20 Nov 2020 16:43:04 +0900
Subject: [PATCH 042/439] Update caliban.md
---
src/content/code/language-support/scala/server/caliban.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/content/code/language-support/scala/server/caliban.md b/src/content/code/language-support/scala/server/caliban.md
index 2319f7f4bb..0644058584 100644
--- a/src/content/code/language-support/scala/server/caliban.md
+++ b/src/content/code/language-support/scala/server/caliban.md
@@ -20,10 +20,10 @@ case class Queries(characters: List[Character])
// resolver
val queries = Queries(getCharacters)
-val query = "{ characters { name } }"
+val api = graphQL(RootResolver(queries))
+
for {
- api = graphQL(RootResolver(queries))
interpreter <- api.interpreter
- result <- interpreter.execute(query)
+ result <- interpreter.execute("{ characters { name } }")
} yield result
```
From 89dec3cbd35d356b605bf1be17268505d5fab7ac Mon Sep 17 00:00:00 2001
From: Carolyn Stransky
Date: Fri, 20 Nov 2020 13:40:47 +0100
Subject: [PATCH 043/439] Implement feedback from GraphQL newbies (#968)
---
src/content/faq/General.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/content/faq/General.md b/src/content/faq/General.md
index 35cee2fffd..515a44f6ba 100644
--- a/src/content/faq/General.md
+++ b/src/content/faq/General.md
@@ -14,11 +14,11 @@ It depends on your use case, but in general, GraphQL has a few key features that
* Create a representation of your data that feels familiar and natural ([a graph](/learn/thinking-in-graphs/#it-s-graphs-all-the-way-down)).
* Ensure that all of your data is [statically typed](/learn/schema/) and these types inform [what queries the schema supports](/learn/introspection/).
* [Reduce the need for breaking changes](/learn/best-practices/#versioning), but utilize a [built-in mechanism for deprecations](https://spec.graphql.org/draft/#sec-Deprecation) when you need to.
-* Access to a [powerful tooling ecosystem](/code/#tools) with GUIs, editor integrations, code generation, linting, analytics, and more.
+* Access to a [powerful tooling ecosystem](/code/#generic-tools) with GUIs, editor integrations, code generation, linting, analytics, and more.
[Our homepage](/) outlines even more reasons to use GraphQL.
-You can try out GraphQL without rewriting your entire application. For example, starting with a single HTTP request that wraps an existing REST call. Your [GraphQL schema](/learn/thinking-in-graphs/#shared-language) and [business domain model](/learn/thinking-in-graphs/#business-logic-layer) can expand gradually. We recommend focusing on one use case at first and only building the part of the schema needed for that.
+You can try out GraphQL without rewriting your entire application. For instance, starting with a single HTTP request that wraps an existing REST call. Your [GraphQL schema](/learn/thinking-in-graphs/#shared-language) and [business domain model](/learn/thinking-in-graphs/#business-logic-layer) can expand gradually. We recommend focusing on one use case at first and only building the part of the schema needed for that.
## Is GraphQL a database language like SQL?
@@ -42,7 +42,7 @@ There are many resources available to help you learn GraphQL, including this web
For more practical guides, visit the [How to GraphQL](https://www.howtographql.com/) fullstack tutorial website. We also have a free online course with edX, [Exploring GraphQL: A Query Language for APIs](https://www.edx.org/course/exploring-graphql-a-query-language-for-apis).
-Before you start your learning journey, make sure you know what an API is and how communication generally works between client and server.
+Before you start your learning journey, make sure you know [what an API is](https://www.codenewbie.org/blogs/an-intro-to-apis) and how communication generally works between client and server.
## Is GraphQL frontend or backend?
@@ -58,7 +58,7 @@ It’s understandable why you’d think this, though. GraphQL was introduced at
GraphQL clients can help you handle [queries, mutations,](/learn/queries/) and [subscriptions](https://spec.graphql.org/draft/#sec-Subscription) to a [GraphQL server](https://www.howtographql.com/advanced/1-server/). They use the underlying structure of a GraphQL API to automate certain processes. This includes batching, UI updates, build-time schema validation, and more.
-A [list of GraphQL clients](/code/#graphql-clients) in various languages is available on our Code page. There’s also an [in-depth explanation of their benefits](https://www.howtographql.com/advanced/0-clients/) on How To GraphQL.
+A list of GraphQL clients in various languages is available on our [Code page](/code/). There’s also an [in-depth explanation of their benefits](https://www.howtographql.com/advanced/0-clients/) on How To GraphQL.
You don't need a specific client to work with GraphQL, though. You might want to start out by [issuing GraphQL results with a regular HTTP client](/learn/serving-over-http/). Then later switch to a GraphQL-optimized client as your application grows in complexity.
@@ -76,6 +76,6 @@ You can find out more by visiting [foundation.graphql.org](https://foundation.gr
## How can I contribute to the GraphQL specification?
-GraphQL is still an evolving language and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub.
+GraphQL is still evolving and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub.
There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation).
From a603253cf663541a21ce086fec57b44cf918ac18 Mon Sep 17 00:00:00 2001
From: Daniel Rearden
Date: Fri, 20 Nov 2020 21:07:07 -0500
Subject: [PATCH 044/439] Add GraphQL Helix example
---
.../javascript/server/graphql-helix.md | 75 +++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/src/content/code/language-support/javascript/server/graphql-helix.md b/src/content/code/language-support/javascript/server/graphql-helix.md
index ed9b8c1bb1..5c872e3ec3 100644
--- a/src/content/code/language-support/javascript/server/graphql-helix.md
+++ b/src/content/code/language-support/javascript/server/graphql-helix.md
@@ -6,4 +6,79 @@ github: contrawork/graphql-helix
npm: "graphql-helix"
---
+To run a hello world server with GraphQL Helix:
+```bash
+npm install graphql graphql-helix express
+```
+
+Then run `node server.js` with this code in `server.js`:
+
+```js
+const express = require('express')
+const {
+ GraphQLObjectType,
+ GraphQLSchema,
+ GraphQLString
+} = require('graphql');
+const {
+ getGraphQLParameters,
+ processRequest,
+ renderGraphiQL,
+ shouldRenderGraphiQL
+} = require('graphql-helix');
+
+const schema = new GraphQLSchema({
+ query: new GraphQLObjectType({
+ name: 'Query',
+ fields: {
+ hello: {
+ type: GraphQLString,
+ resolve: () => 'Hello world!',
+ },
+ },
+ }),
+});
+
+const app = express();
+
+app.use(express.json());
+
+app.use('/graphql', async (req, res) => {
+ const request = {
+ body: req.body,
+ headers: req.headers,
+ method: req.method,
+ query: req.query,
+ };
+
+ if (shouldRenderGraphiQL(request)) {
+ res.send(renderGraphiQL());
+ } else {
+ const { operationName, query, variables } = getGraphQLParameters(request);
+
+ const result = await processRequest({
+ operationName,
+ query,
+ variables,
+ request,
+ schema,
+ });
+
+ if (result.type === 'RESPONSE') {
+ result.headers.forEach(({ name, value }) => res.setHeader(name, value));
+ res.status(result.status);
+ res.json(result.payload);
+ } else {
+ // graphql-helix also supports subscriptions and incremental delivery (i.e. @defer and @stream directives)
+ // out of the box. See the repo for more complete examples that also implement those features.
+ }
+ }
+});
+
+app.listen(4000, () =>
+ console.log('Now browse to http://localhost:4000/graphql');
+)
+```
+
+This example uses Express, but GraphQL Helix is framework- and runtime-agnostic -- it can run in Node, Deno and the browser. GraphQL Helix provides you with a handful of utility functions to build your own HTTP server but leaves the ultimate implementation details up to you.
From e0895802dc81936b3f52480456bf6eb179ec5951 Mon Sep 17 00:00:00 2001
From: Michael Staib
Date: Sat, 21 Nov 2020 09:26:55 +0100
Subject: [PATCH 045/439] Update hot-chocolate.md
---
.../c-net/server/hot-chocolate.md | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/content/code/language-support/c-net/server/hot-chocolate.md b/src/content/code/language-support/c-net/server/hot-chocolate.md
index e762f13acc..3f944355b3 100644
--- a/src/content/code/language-support/c-net/server/hot-chocolate.md
+++ b/src/content/code/language-support/c-net/server/hot-chocolate.md
@@ -5,4 +5,32 @@ url: https://github.com/ChilliCream/hotchocolate
github: ChilliCream/hotchocolate
---
+```csharp
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.DependencyInjection;
+WebHost
+ .CreateDefaultBuilder(args)
+ .ConfigureServices(services =>
+ services
+ .AddGraphQLServer()
+ .AddQueryType())
+ .Configure(builder =>
+ builder
+ .UseRouting()
+ .UseEndpoints(e => e.MapGraphQL()))
+ .Build()
+ .Run();
+
+public class Query
+{
+ public Hero GetHero() => new Hero();
+}
+
+public class Hero
+{
+ public string Name => "Luke Skywalker";
+}
+```
From 83094b8b351227d4dc0ae79e19c1b9d33de67970 Mon Sep 17 00:00:00 2001
From: Carolyn Stransky
Date: Mon, 23 Nov 2020 16:57:15 +0100
Subject: [PATCH 046/439] Add contributing guide (#970)
* Initial commit - shiny new contributing guide
* Grammar and clarity tweaks
* More tweaks
---
CONTRIBUTING.md | 130 ++++++++++++++++++++++++++++++++++++++++++++++++
README.md | 34 ++-----------
2 files changed, 133 insertions(+), 31 deletions(-)
create mode 100644 CONTRIBUTING.md
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..c42de3709b
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,130 @@
+# Contributing to graphql.org
+
+> This repository is governed by the [GraphQL Code of Conduct](https://graphql.org/codeofconduct/). By contributing, you agree to abide by its terms.
+
+Thanks for taking the time to contribute! The GraphQL community is great because of people like you 🎉
+
+There are many ways to get involved. Follow this guide and feel free to [reach out if you have questions](#asking-questions).
+
+## What's in this document
+
+- [Development guide](#development-guide)
+ - [Running the site locally](#running-the-site-locally)
+ - [Branching](#branching)
+ - [Project structure](#project-structure)
+ - [Publishing the updated site](#publishing-the-updated-site)
+- [Updating content](#updating-content)
+ - [Fix a typo, code sample bug, or formatting](#fix-a-typo-code-sample-bug-or-formatting)
+ - [Add a library or tool to the Code page](#add-a-library-or-tool-to-the-code-page)
+ - [Add a resource to the Community page](#add-a-resource-to-the-community-page)
+ - [Add a question to the FAQ](#add-a-question-to-the-faq)
+ - [Write a new section or guide](#write-a-new-section-or-guide)
+- [Making changes to the code](#making-changes-to-the-code)
+- [Contributing something else](#contributing-something-else)
+- [Asking questions](#asking-questions)
+
+## Development guide
+
+### Running the site locally
+
+First, clone this repository and move into the directory:
+
+```bash
+git clone https://github.com/graphql/graphql.github.io.git
+cd graphql.github.io
+```
+
+Then, use [Yarn](https://yarnpkg.com/getting-started/install) to install and load all the necessary dependencies:
+
+```bash
+yarn
+```
+
+> Note: [Yarn is currently the only way to run the site locally](https://github.com/graphql/graphql.github.io/issues/946).
+
+Run the `start` script to launch the server:
+
+```bash
+yarn start
+```
+
+Finally, open [http://localhost:8000](http://localhost:8000) to view it in the browser.
+
+The GraphQL website is built with [Gatsby](https://www.gatsbyjs.com/docs/). This means that a hot-reloading development environment will be accessible by default.
+
+### Branching
+
+Active development for graphql.org happens on the `source` branch. Be sure to create any new branches or direct any pull requests back to `source`.
+
+### Project structure
+
+- `static`: Files that will be copied directly to `public`.
+- `public`: Output files that will be served by a static HTTP server.
+- `src`: Markdown and the TypeScript/JavaScript files used to generate the website.
+ - `assets`: All the [`less`](http://lesscss.org/) files that contain stylesheets.
+ - `components` and `Containers`: React components used for layouts and pages.
+ - `content`: Markdown files with the content of pages.
+ - `templates`: Layout templates.
+ - `utils`: Helper functions.
+
+### Publishing the updated site
+
+Your changes will be merged into the `source` branch. Then, the CI will automatically publish a new version of http://graphql.org via [Netlify](https://docs.netlify.com/).
+
+## Updating content
+
+### Fix a typo, code sample bug, or formatting
+
+If you notice something wrong in the text or code samples, please follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls) with your fix.
+
+All of the content on graphql.org is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
+
+### Add a library or tool to the Code page
+
+The [Code page](https://graphql.org/code/) is a collection of libraries, tools, and services built for GraphQL.
+
+To add your resource to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
+
+The content for this page is located in [various directories under `src/content/code`](./src/). Everything is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
+
+### Add a resource to the Community page
+
+The [Community page](https://graphql.org/community/) highlights resources and groups that help people get more involved with GraphQL.
+
+To add something to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
+
+The content for this page is located in a [directory under `src/content/community`](./src/). Everything is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
+
+### Add a question to the FAQ
+
+Our [Frequently Asked Questions (FAQ) page](https://graphql.org/faq/) is designed to help answer questions from the community. This page is still in development, so if you think there's a question missing - please [open an issue](https://github.com/graphql/graphql.github.io/issues/new)! It'd be great if you could include both the question and a proposed answer outline in the issue description.
+
+Once you have approval from a maintainer, use the [development guide](#development-guide) to add your question and answer. The content for the FAQ is located in [`src/content/faq`](./src/content/faq/). Each section has its own [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/) file.
+
+> Note: All answers in this section should be vendor-neutral and accessible to GraphQL users of all levels.
+
+When your answer is ready, [open a pull request](https://github.com/graphql/graphql.github.io/pulls/).
+
+### Write a new section or guide
+
+There are still several [Best Practices guides that no one has written](https://github.com/graphql/graphql.github.io/issues/41) yet. If you want to take one of these, comment on [the original issue](https://github.com/graphql/graphql.github.io/issues/41) and mention which topic you'll work on.
+
+Then, use our [development guide](#development-guide) to determine where your new page best fits. Our documentation is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
+
+Once it's ready for review, please [open a pull request](https://github.com/graphql/graphql.github.io/pulls/).
+
+## Making changes to the code
+
+Before diving into any code updates, please [open an issue](https://github.com/graphql/graphql.github.io/issues/new) describing the change(s) you'd like to make.
+
+If you're working off an [existing issue](https://github.com/graphql/graphql.github.io/issues/), follow our [development guide](#development-guide) to make your changes. Once it's ready for review, please [open a pull request](https://github.com/graphql/graphql.github.io/pulls/) and reference the original issue.
+
+## Contributing something else
+
+Interested in adding something not covered in this guide? Please [open an issue](https://github.com/graphql/graphql.github.io/issues/new) and tell us all about your idea.
+
+## Asking questions
+
+If you run into any problems or have questions while contributing, you're always welcome to [open an issue](https://github.com/graphql/graphql.github.io/issues/new).
+
+You can also ping our team in the [#website channel on the GraphQL Slack](https://graphql.slack.com/messages/website/). [Get your invite here!](https://graphql-slack.herokuapp.com/)
\ No newline at end of file
diff --git a/README.md b/README.md
index bca1cb5b67..f660b9af86 100644
--- a/README.md
+++ b/README.md
@@ -1,35 +1,7 @@
# Source Repository for graphql.org
-This repository contains the source code of https://graphql.org website.
-
-# Contributing
-
-Organization gh-pages deploy the `master` branch, so active development occurs
-on this `source` branch.
-
-### Making changes
-
-The first time, get all the dependencies loaded via
-
-`$ npm install` or `$ yarn install`
-Then, run the server via
-
-`$ npm start` or `$ yarn start`
-
-Open [http://localhost:8000](http://localhost:8000) to view it in the browser.
-Anytime you make some changes, refresh the page to see the updates.
-
-### Folder structure
-
-- `static` folder contains the files that will be copied directly to `public` folder which will contain the output files to be served by a static HTTP server.
-
-- `src` folder contains markdown and TypeScript/JavaScript files used to generate the website;
-- - `assets` folder contains `less` files and those files contain stylesheets
-- - `components` and `Containers` folders contains React components that are used in layouts and pages
-- - `content` folder contains markdown files for the content of pages
-- - `templates` contains the layout templates
-- - `utils` contains helper functions
+This repository contains the source code of https://graphql.org website.
-### Publish the Website
+## Contributing
-Once pushed to the `source` branch, CI will publish http://graphql.org
+Check out our [contributing guide](./CONTRIBUTING.md) for detailed instructions for how to make changes to graphql.org 🎉
\ No newline at end of file
From cadd0089a30edbba22f212b9753c5356fd7cee2c Mon Sep 17 00:00:00 2001
From: "rivantsov@gmail.com"
Date: Mon, 23 Nov 2020 15:57:51 -0800
Subject: [PATCH 047/439] added NGraphQL link
---
src/content/code/language-support/c-net/server/ngraphql.md | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 src/content/code/language-support/c-net/server/ngraphql.md
diff --git a/src/content/code/language-support/c-net/server/ngraphql.md b/src/content/code/language-support/c-net/server/ngraphql.md
new file mode 100644
index 0000000000..e5f922e268
--- /dev/null
+++ b/src/content/code/language-support/c-net/server/ngraphql.md
@@ -0,0 +1,6 @@
+---
+name: NGraphQL
+description: A set of packages for implementing GraphQL servers in .NET
+url: https://github.com/rivantsov/ngraphql
+github: rivantsov/ngraphql
+---
From a7a285f3f91f0a93edb3691fd51caf2992c12fac Mon Sep 17 00:00:00 2001
From: carolstran
Date: Tue, 24 Nov 2020 12:18:46 +0100
Subject: [PATCH 048/439] Add issue and PR templates
---
.github/ISSUE_TEMPLATE/bug-report.md | 32 ++++++++++++++++++++++
.github/ISSUE_TEMPLATE/code-changes.md | 23 ++++++++++++++++
.github/ISSUE_TEMPLATE/new-faq-question.md | 23 ++++++++++++++++
.github/ISSUE_TEMPLATE/question.md | 7 +++++
.github/PULL_REQUEST_TEMPLATE.md | 15 ++++++++++
5 files changed, 100 insertions(+)
create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md
create mode 100644 .github/ISSUE_TEMPLATE/code-changes.md
create mode 100644 .github/ISSUE_TEMPLATE/new-faq-question.md
create mode 100644 .github/ISSUE_TEMPLATE/question.md
create mode 100644 .github/PULL_REQUEST_TEMPLATE.md
diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md
new file mode 100644
index 0000000000..90cff75711
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug-report.md
@@ -0,0 +1,32 @@
+---
+name: "Bug Report"
+about: Notice something off? Tell us about it here.
+labels: bug
+---
+
+
+
+### Description
+
+
+
+### Steps to Reproduce
+
+
+
+### Expected Result
+
+
+
+### Actual Result
+
+
+
+### Additional Context
+
+
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/code-changes.md b/.github/ISSUE_TEMPLATE/code-changes.md
new file mode 100644
index 0000000000..ad751612cd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/code-changes.md
@@ -0,0 +1,23 @@
+---
+name: "Code Changes"
+about: Tell us more about how you want to improve graphql.org
+labels: enhancement
+---
+
+
+
+### Description
+
+
+
+### Motivation
+
+
+
+### Collaboration
+
+
+
+### Additional Context
+
+
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/new-faq-question.md b/.github/ISSUE_TEMPLATE/new-faq-question.md
new file mode 100644
index 0000000000..d596fb62c0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new-faq-question.md
@@ -0,0 +1,23 @@
+---
+name: "New FAQ Question"
+about: Propose a new question to add to our FAQ page
+labels: faq
+---
+
+
+
+### Question
+
+
+
+### Proposed answer
+
+
+
+### Collaboration
+
+
+
+### Additional Context
+
+
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
new file mode 100644
index 0000000000..d45f50dd58
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -0,0 +1,7 @@
+---
+name: "Question"
+about: Ask us anything!
+labels: question
+---
+
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000..9b9f5e0d5f
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,15 @@
+
+
+Closes #
+
+## Description
+
+
\ No newline at end of file
From a2132ac50341b1a38ec2122403485e1fd0bf2160 Mon Sep 17 00:00:00 2001
From: "rivantsov@gmail.com"
Date: Wed, 25 Nov 2020 06:46:51 -0800
Subject: [PATCH 049/439] added to description
---
src/content/code/language-support/c-net/server/ngraphql.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content/code/language-support/c-net/server/ngraphql.md b/src/content/code/language-support/c-net/server/ngraphql.md
index e5f922e268..f66baf6fc3 100644
--- a/src/content/code/language-support/c-net/server/ngraphql.md
+++ b/src/content/code/language-support/c-net/server/ngraphql.md
@@ -1,6 +1,6 @@
---
name: NGraphQL
-description: A set of packages for implementing GraphQL servers in .NET
+description: A set of packages for implementing high-performant GraphQL servers in .NET. Faithful implementation of official 2018 Specification. Features: batched execution (aka Data Loader); support for custom scalars; HTTP server based on ASP.NET Core; parsed query cache; modular API construction (equivalent of schema stiching); full introspection support; runtime metrics and quotas.
url: https://github.com/rivantsov/ngraphql
github: rivantsov/ngraphql
---
From 217cbdda436102786668a4efd27bf52b2fece2f7 Mon Sep 17 00:00:00 2001
From: "rivantsov@gmail.com"
Date: Wed, 25 Nov 2020 06:51:49 -0800
Subject: [PATCH 050/439] fix wfl error
---
src/content/code/language-support/c-net/server/ngraphql.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/content/code/language-support/c-net/server/ngraphql.md b/src/content/code/language-support/c-net/server/ngraphql.md
index f66baf6fc3..bec5356bba 100644
--- a/src/content/code/language-support/c-net/server/ngraphql.md
+++ b/src/content/code/language-support/c-net/server/ngraphql.md
@@ -1,6 +1,8 @@
---
name: NGraphQL
-description: A set of packages for implementing high-performant GraphQL servers in .NET. Faithful implementation of official 2018 Specification. Features: batched execution (aka Data Loader); support for custom scalars; HTTP server based on ASP.NET Core; parsed query cache; modular API construction (equivalent of schema stiching); full introspection support; runtime metrics and quotas.
+description: A set of packages for implementing high-performant GraphQL servers in .NET. Faithful implementation of official 2018 Specification.
+
+Features batched execution support (aka Data Loader); support for custom scalars; HTTP server based on ASP.NET Core; parsed query cache; modular API construction (equivalent of schema stiching); full introspection support; runtime metrics and quotas.
url: https://github.com/rivantsov/ngraphql
github: rivantsov/ngraphql
---
From 1f6fcc2728c5c2a34e920160291dbb340df29743 Mon Sep 17 00:00:00 2001
From: "rivantsov@gmail.com"
Date: Wed, 25 Nov 2020 06:54:39 -0800
Subject: [PATCH 051/439] build error
---
src/content/code/language-support/c-net/server/ngraphql.md | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/content/code/language-support/c-net/server/ngraphql.md b/src/content/code/language-support/c-net/server/ngraphql.md
index bec5356bba..f9a94187b0 100644
--- a/src/content/code/language-support/c-net/server/ngraphql.md
+++ b/src/content/code/language-support/c-net/server/ngraphql.md
@@ -1,8 +1,6 @@
---
name: NGraphQL
-description: A set of packages for implementing high-performant GraphQL servers in .NET. Faithful implementation of official 2018 Specification.
-
-Features batched execution support (aka Data Loader); support for custom scalars; HTTP server based on ASP.NET Core; parsed query cache; modular API construction (equivalent of schema stiching); full introspection support; runtime metrics and quotas.
+description: A set of packages for implementing high-performant GraphQL servers in .NET. Faithful implementation of official 2018 Specification. Features batched execution support (aka Data Loader); support for custom scalars; HTTP server based on ASP.NET Core; parsed query cache; modular API construction (equivalent of schema stiching); full introspection support; runtime metrics and quotas.
url: https://github.com/rivantsov/ngraphql
github: rivantsov/ngraphql
---
From ef51a051076f666b9977e1c8711930fe51981706 Mon Sep 17 00:00:00 2001
From: Deepak <69639135+Deepak-du@users.noreply.github.com>
Date: Wed, 25 Nov 2020 22:39:46 +0530
Subject: [PATCH 052/439] Update README.md (#979)
* Update README.md
Readme file has been updated in a detailed way.
* Update README.md
Co-authored-by: Michael Esteban
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
* Update README.md
Co-authored-by: Carolyn Stransky
Co-authored-by: Michael Esteban
Co-authored-by: Carolyn Stransky
---
README.md | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index f660b9af86..75e07b1066 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,18 @@
# Source Repository for graphql.org
-This repository contains the source code of https://graphql.org website.
+This repository contains the source code for the [GraphQL website](https://graphql.org).
-## Contributing
+> You can find more discussions on the [#website channel on the GraphQL Slack](https://graphql.slack.com/messages/website/). [Get your invite here!](https://graphql-slack.herokuapp.com/)
-Check out our [contributing guide](./CONTRIBUTING.md) for detailed instructions for how to make changes to graphql.org 🎉
\ No newline at end of file
+
+A brief overview: **GraphQL** is a query language for APIs and a runtime for fulfilling those queries with your existing data. It provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need, and enables powerful developer tools. The [specification](https://spec.graphql.org/) is open source and governed by the [GraphQL Foundation](https://foundation.graphql.org/).
+
+## Documentation
+- [Site](https://graphql.org/)
+- [Reference documentation](https://graphql.org/learn/)
+- [Language support, tools, and services](https://graphql.org/code/)
+- [Frequently Asked Questions (FAQ)](https://graphql.org/faq/)
+- [Community resources](https://graphql.org/community/)
+
+## How to contribute
+Check out our [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to make changes to the GraphQL website 🎉
From a4d934d740637e6c73b302d148754d05ca12f089 Mon Sep 17 00:00:00 2001
From: Leonardo Losoviz
Date: Thu, 26 Nov 2020 13:50:49 +0800
Subject: [PATCH 053/439] Added "GraphQL by PoP" server in PHP
---
.../code/language-support/php/server/graphql-by-pop.md | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 src/content/code/language-support/php/server/graphql-by-pop.md
diff --git a/src/content/code/language-support/php/server/graphql-by-pop.md b/src/content/code/language-support/php/server/graphql-by-pop.md
new file mode 100644
index 0000000000..366891353a
--- /dev/null
+++ b/src/content/code/language-support/php/server/graphql-by-pop.md
@@ -0,0 +1,8 @@
+---
+name: GraphQL by PoP
+description: CMS-agnostic GraphQL server in PHP
+url: https://graphql-by-pop.com
+github: GraphQLByPoP/graphql-server
+---
+
+
From 7689a0a64baa6105a28e3b0224758a1165bd7514 Mon Sep 17 00:00:00 2001
From: Arpit Kushwaha <29251567+shark-h@users.noreply.github.com>
Date: Fri, 27 Nov 2020 17:08:46 +0530
Subject: [PATCH 054/439] Update Community-Events.md
updated upcoming event details.
---
src/content/community/Community-Events.md | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/content/community/Community-Events.md b/src/content/community/Community-Events.md
index 35e6370a3b..dbdb8085e0 100644
--- a/src/content/community/Community-Events.md
+++ b/src/content/community/Community-Events.md
@@ -8,18 +8,10 @@ sublinks: Upcoming Events,Meetups
## Upcoming Events
-### Byteconf GraphQL
-
-- **Date:** January 31, 2020
-- **Location:** Streamed online
-- **Link:** https://www.bytesized.xyz/graphql-2020
-
-Free GraphQL conference live-streamed on YouTube
-
### GraphQL Asia
-- **Date:** February 20-22, 2020
-- **Location:** Bangalore, India
+- **Date:** February, 2021
+- **Location:** Online
- **Link:** https://graphql.asia
GraphQL conference organized by Hasura
From 233996e0a3d5d8c605eebf63670ded9755fda95e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3gvan=20Olsen?=
Date: Fri, 27 Nov 2020 17:32:18 +0000
Subject: [PATCH 055/439] Added KGraphQL to the code list
---
.../java-kotlin-android/server/kgraphql.md | 61 +++++++++++++++++++
1 file changed, 61 insertions(+)
create mode 100644 src/content/code/language-support/java-kotlin-android/server/kgraphql.md
diff --git a/src/content/code/language-support/java-kotlin-android/server/kgraphql.md b/src/content/code/language-support/java-kotlin-android/server/kgraphql.md
new file mode 100644
index 0000000000..ffdbb546ad
--- /dev/null
+++ b/src/content/code/language-support/java-kotlin-android/server/kgraphql.md
@@ -0,0 +1,61 @@
+---
+name: KGraphQL
+description: KGraphQL is a Kotlin implementation of GraphQL. It provides a rich DSL to set up the GraphQL schema.
+url: https://kgraphql.io/
+github: aPureBase/KGraphQL
+---
+
+Here's a simple example on how to create a simple schema based on a kotlin data class plus a property resolver that gets applied onto your class.
+
+```kotlin
+data class Article(val id: Int, val text: String)
+
+fun main() {
+ val schema = KGraphQL.schema {
+ query("article") {
+ resolver { id: Int?, text: String ->
+ Article(id ?: -1, text)
+ }
+ }
+ type {
+ property("fullText") {
+ resolver { article: Article ->
+ "${article.id}: ${article.text}"
+ }
+ }
+ }
+ }
+
+ schema.execute("""
+ {
+ article(id: 5, text: "Hello World") {
+ id
+ fullText
+ }
+ }
+ """).let(::println)
+}
+```
+
+KGraphQL is using coroutines behind the scenes to provide great asynchronous performance.
+
+See [KGraphQL docs](https://kgraphql.io/Installation/) for more in depth usage.
+
+## Ktor Plugin
+
+KGraphQL has a Ktor plugin which gives you a fully functional GraphQL server with a single [install](https://ktor.io/docs/zfeatures.html) function call. Example below shows how to set up a GraphQL server within Ktor and it will give you a [GraphQL Playground](https://github.com/graphql/graphql-playground) out of the box by entering `localhost:8080/graphql`.
+
+```kotlin
+fun Application.module() {
+ install(GraphQL) {
+ playground = true
+ schema {
+ query("hello") {
+ resolver { -> "World!" }
+ }
+ }
+ }
+}
+```
+
+You can follow the [Ktor tutorial](https://kgraphql.io/Tutorials/ktor/) to set up a KGraphQL server with ktor from scratch up.
From 731208a652e24ece2b17f7fddcef0d327219dd2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3gvan=20Olsen?=
Date: Fri, 27 Nov 2020 17:56:03 +0000
Subject: [PATCH 056/439] Update kgraphql.md
---
.../language-support/java-kotlin-android/server/kgraphql.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content/code/language-support/java-kotlin-android/server/kgraphql.md b/src/content/code/language-support/java-kotlin-android/server/kgraphql.md
index ffdbb546ad..bd73f061f1 100644
--- a/src/content/code/language-support/java-kotlin-android/server/kgraphql.md
+++ b/src/content/code/language-support/java-kotlin-android/server/kgraphql.md
@@ -5,7 +5,7 @@ url: https://kgraphql.io/
github: aPureBase/KGraphQL
---
-Here's a simple example on how to create a simple schema based on a kotlin data class plus a property resolver that gets applied onto your class.
+Here's an example on how to create a simple schema based on a kotlin data class plus a property resolver that gets applied onto your class.
```kotlin
data class Article(val id: Int, val text: String)
From 08d292d9eea4a9e76f705e57b0f069109f70d2de Mon Sep 17 00:00:00 2001
From: Leonardo Losoviz
Date: Sun, 29 Nov 2020 23:38:45 +0800
Subject: [PATCH 057/439] Added description for GraphQL by PoP
---
.../php/server/graphql-by-pop.md | 114 +++++++++++++++++-
1 file changed, 113 insertions(+), 1 deletion(-)
diff --git a/src/content/code/language-support/php/server/graphql-by-pop.md b/src/content/code/language-support/php/server/graphql-by-pop.md
index 366891353a..6bba9a334e 100644
--- a/src/content/code/language-support/php/server/graphql-by-pop.md
+++ b/src/content/code/language-support/php/server/graphql-by-pop.md
@@ -1,8 +1,120 @@
---
name: GraphQL by PoP
-description: CMS-agnostic GraphQL server in PHP
+description: CMS-agnostic GraphQL server in PHP. It follows the code-first approach, generating the schema dynamically
url: https://graphql-by-pop.com
github: GraphQLByPoP/graphql-server
---
+GraphQL by PoP follows the [code-first approach](https://graphql-by-pop.com/docs/architecture/code-first.html) to generate the schema (it can be customized for different clients/applications). Fields are dynamically "subscribed" to types, and may or may not be added to the schema depending on the context.
+This is how a `User` type is satisfied:
+
+```php
+class UserTypeResolver extends AbstractTypeResolver
+{
+ public function getTypeName(): string
+ {
+ return 'User';
+ }
+
+ public function getSchemaTypeDescription(): ?string
+ {
+ $translationAPI = TranslationAPIFacade::getInstance();
+ return $translationAPI->__('Representation of a user', 'users');
+ }
+
+ public function getID(object $user)
+ {
+ return $user->ID;
+ }
+
+ public function getTypeDataLoaderClass(): string
+ {
+ return UserTypeDataLoader::class;
+ }
+}
+```
+
+Please notice how the `TypeResolver` does not indicate which are its fields. It also does not load the objects from the database, but instead delegates this task to a `TypeDataLoader`.
+
+Adding fields to the type is done via a `FieldResolver`:
+
+```php
+class UserFieldResolver extends AbstractDBDataFieldResolver
+{
+ public static function getClassesToAttachTo(): array
+ {
+ return [
+ UserTypeResolver::class,
+ ];
+ }
+
+ public static function getFieldNamesToResolve(): array
+ {
+ return [
+ 'username',
+ 'email',
+ 'url',
+ ];
+ }
+
+ public function getSchemaFieldDescription(
+ TypeResolverInterface $typeResolver,
+ string $fieldName
+ ): ?string {
+ $translationAPI = TranslationAPIFacade::getInstance();
+ $descriptions = [
+ 'username' => $translationAPI->__("User's username handle", "users"),
+ 'email' => $translationAPI->__("User's email", "users"),
+ 'url' => $translationAPI->__("URL of the user's profile in the website", "users"),
+ ];
+ return $descriptions[$fieldName];
+ }
+
+ public function getSchemaFieldType(
+ TypeResolverInterface $typeResolver,
+ string $fieldName
+ ): ?string {
+ $types = [
+ 'username' => SchemaDefinition::TYPE_STRING,
+ 'email' => SchemaDefinition::TYPE_EMAIL,
+ 'url' => SchemaDefinition::TYPE_URL,
+ ];
+ return $types[$fieldName];
+ }
+
+ public function resolveValue(
+ TypeResolverInterface $typeResolver,
+ object $user,
+ string $fieldName,
+ array $fieldArgs = []
+ ) {
+ switch ($fieldName) {
+ case 'username':
+ return $user->user_login;
+
+ case 'email':
+ return $user->user_email;
+
+ case 'url':
+ $userService = UserServiceFacade::getInstance();
+ return $userService->getUserProfileURL($user->ID);
+ }
+
+ return null;
+ }
+}
+```
+
+The definition of a field for the GraphQL schema, and its resolution, is split into a multitude of functions from the `FieldResolver`:
+
+- `getSchemaFieldDescription`
+- `getSchemaFieldType`
+- `resolveValue`
+- `getSchemaFieldArgs`
+- `isSchemaFieldResponseNonNullable`
+- `getImplementedInterfaceClasses`
+- `resolveFieldTypeResolverClass`
+- `resolveFieldMutationResolverClass`
+
+This code is more legible than if all functionality is satisfied through a single function, or through a configuration array, making it easier to implement and maintain the resolvers.
From 390139a52ff4740401406ad009d35d3947ddfb48 Mon Sep 17 00:00:00 2001
From: Carolyn Stransky
Date: Thu, 10 Dec 2020 10:58:49 +0100
Subject: [PATCH 058/439] Update contributing guide to include browser support
---
CONTRIBUTING.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c42de3709b..827baeca19 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -20,6 +20,7 @@ There are many ways to get involved. Follow this guide and feel free to [reach o
- [Add a question to the FAQ](#add-a-question-to-the-faq)
- [Write a new section or guide](#write-a-new-section-or-guide)
- [Making changes to the code](#making-changes-to-the-code)
+ - [Browser support](#browser-support)
- [Contributing something else](#contributing-something-else)
- [Asking questions](#asking-questions)
@@ -119,6 +120,10 @@ Before diving into any code updates, please [open an issue](https://github.com/g
If you're working off an [existing issue](https://github.com/graphql/graphql.github.io/issues/), follow our [development guide](#development-guide) to make your changes. Once it's ready for review, please [open a pull request](https://github.com/graphql/graphql.github.io/pulls/) and reference the original issue.
+### Browser support
+
+We aim to support the latest stable versions of Chrome, Edge, Firefox, Safari, and Safari on mobile.
+
## Contributing something else
Interested in adding something not covered in this guide? Please [open an issue](https://github.com/graphql/graphql.github.io/issues/new) and tell us all about your idea.
@@ -127,4 +132,4 @@ Interested in adding something not covered in this guide? Please [open an issue]
If you run into any problems or have questions while contributing, you're always welcome to [open an issue](https://github.com/graphql/graphql.github.io/issues/new).
-You can also ping our team in the [#website channel on the GraphQL Slack](https://graphql.slack.com/messages/website/). [Get your invite here!](https://graphql-slack.herokuapp.com/)
\ No newline at end of file
+You can also ping our team in the [#website channel on the GraphQL Slack](https://graphql.slack.com/messages/website/). [Get your invite here!](https://graphql-slack.herokuapp.com/)
From 9ce150d8726633e9c72a9d08ec0b7b219f95d19c Mon Sep 17 00:00:00 2001
From: Flavio Corpa
Date: Thu, 10 Dec 2020 12:40:55 +0100
Subject: [PATCH 059/439] =?UTF-8?q?Add=20mu-haskell=20as=20another=20Haske?=
=?UTF-8?q?ll=20GraphQL=20Server=20alternative!=20=F0=9F=9A=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../haskell/server/mu-haskell.md | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 src/content/code/language-support/haskell/server/mu-haskell.md
diff --git a/src/content/code/language-support/haskell/server/mu-haskell.md b/src/content/code/language-support/haskell/server/mu-haskell.md
new file mode 100644
index 0000000000..f56f8f6053
--- /dev/null
+++ b/src/content/code/language-support/haskell/server/mu-haskell.md
@@ -0,0 +1,56 @@
+---
+name: Mu-Haskell with Mu-GraphQL
+description: A Haskell library for building microservices (gRPC, HTTP) and GraphQL APIs.
+url: https://github.com/higherkindness/mu-haskell
+github: higherkindness/mu-haskell
+---
+
+Example implementation of a GraphQL server with type-level representation of the schema auto-generated:
+
+```haskell
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE PartialTypeSignatures #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeOperators #-}
+
+-- imports omitted for brevity...
+
+graphql "Library" "library.graphql" -- all the magic happens here! 🪄🎩
+
+-- ... a bit more code...
+
+libraryServer :: SqlBackend -> ServerT ObjectMapping i Library ServerErrorIO _
+libraryServer conn =
+ resolver
+ ( object @"Book"
+ ( field @"id" bookId,
+ field @"title" bookTitle,
+ field @"author" bookAuthor,
+ field @"imageUrl" bookImage
+ ),
+ object @"Author"
+ ( field @"id" authorId,
+ field @"name" authorName,
+ field @"books" authorBooks
+ ),
+ object @"Query"
+ ( method @"authors" allAuthors,
+ method @"books" allBooks
+ ),
+ object @"Mutation"
+ ( method @"newAuthor" newAuthor,
+ method @"newBook" newBook
+ ),
+ object @"Subscription"
+ (method @"allBooks" allBooksConduit)
+ )
+ where
+ bookId :: Entity Book -> ServerErrorIO Integer
+ bookId (Entity (BookKey k) _) = pure $ toInteger k
+ -- ... more resolvers...
+```
+
+See [our docs](https://higherkindness.io/mu-haskell/graphql/) for more information about how to build your own GraphQL server and [the library example](https://github.com/higherkindness/mu-graphql-example-elm) for a more end-to-end example that includes a client written in Elm!
From 8a7df71fa74a92d98c704a86e7c45bc8c7fe197c Mon Sep 17 00:00:00 2001
From: Flavio Corpa
Date: Thu, 10 Dec 2020 12:47:01 +0100
Subject: [PATCH 060/439] Add docs website
---
src/content/code/language-support/haskell/server/mu-haskell.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content/code/language-support/haskell/server/mu-haskell.md b/src/content/code/language-support/haskell/server/mu-haskell.md
index f56f8f6053..636f68d248 100644
--- a/src/content/code/language-support/haskell/server/mu-haskell.md
+++ b/src/content/code/language-support/haskell/server/mu-haskell.md
@@ -1,7 +1,7 @@
---
name: Mu-Haskell with Mu-GraphQL
description: A Haskell library for building microservices (gRPC, HTTP) and GraphQL APIs.
-url: https://github.com/higherkindness/mu-haskell
+url: https://higherkindness.io/mu-haskell/
github: higherkindness/mu-haskell
---
From 32bddc7e3b7964670c6abd476531a7cd310158bf Mon Sep 17 00:00:00 2001
From: Simone Busoli
Date: Sat, 12 Dec 2020 09:09:29 +0100
Subject: [PATCH 061/439] Add graphql-hooks client library
---
.../language-support/javascript/client/graphql-hooks.md | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 src/content/code/language-support/javascript/client/graphql-hooks.md
diff --git a/src/content/code/language-support/javascript/client/graphql-hooks.md b/src/content/code/language-support/javascript/client/graphql-hooks.md
new file mode 100644
index 0000000000..692e40ffc7
--- /dev/null
+++ b/src/content/code/language-support/javascript/client/graphql-hooks.md
@@ -0,0 +1,7 @@
+---
+name: graphql-hooks
+description: Minimal hooks-first GraphQL client.
+url: https://github.com/nearform/graphql-hooks
+github: nearform/graphql-hooks
+npm: "graphql-hooks"
+---
From 01c9fa653f97cbaa5d8112123a65bb36c9b60a85 Mon Sep 17 00:00:00 2001
From: Carolyn Stransky
Date: Sat, 12 Dec 2020 16:33:00 +0100
Subject: [PATCH 062/439] Update contributing guidelines for Code page (#980)
* Updating contributing guidelines for Code page
* Fix mistakes oops
---
CONTRIBUTING.md | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c42de3709b..f93a75369a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -79,11 +79,30 @@ If you notice something wrong in the text or code samples, please follow our [de
All of the content on graphql.org is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
-### Add a library or tool to the Code page
+### Add a library, tool, or service to the Code page
-The [Code page](https://graphql.org/code/) is a collection of libraries, tools, and services built for GraphQL.
+The [Code page](https://graphql.org/code/) is a collection of libraries, tools, and services built for GraphQL.
-To add your resource to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
+#### General guidelines
+
+**Adding a resource:**
+- With rare exceptions, any pull request that adds a new library, tool, or service to the Code page will be accepted.
+- Any library should include a few paragraphs describing the usage and offering people a chance to grok the project priorities.
+- If there isn't a section already for your programming language, please add it.
+
+If it isn't a library, tool, or service - then it could go on the [Community page](#add-a-resource-to-the-community-page). If you aren't sure where your resource would fit, you can [open an issue](https://github.com/graphql/graphql.github.io/issues/new) and ask.
+
+**Removing a resource:**
+- Services that don't work anymore
+- Code repositories that are archived
+- Projects declared to be abandoned by their maintainers
+- Any link that 404s
+
+We rely on these concrete signals before removing a resource. Even if a project hasn't been released in a few years, that doesn't mean that it's not working.
+
+#### Workflow
+
+To add or remove a resource to this page, follow our [development guide](#development-guide) to [open a pull request](https://github.com/graphql/graphql.github.io/pulls).
The content for this page is located in [various directories under `src/content/code`](./src/). Everything is written and formatted in [Markdown](https://www.gatsbyjs.com/docs/mdx/markdown-syntax/).
From 961d350a492cc405a5b20b124dd471ee515f0ddb Mon Sep 17 00:00:00 2001
From: Simone Busoli
Date: Sun, 13 Dec 2020 22:46:29 +0100
Subject: [PATCH 063/439] add more description
---
.../code/language-support/javascript/client/graphql-hooks.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content/code/language-support/javascript/client/graphql-hooks.md b/src/content/code/language-support/javascript/client/graphql-hooks.md
index 692e40ffc7..eb0f43e526 100644
--- a/src/content/code/language-support/javascript/client/graphql-hooks.md
+++ b/src/content/code/language-support/javascript/client/graphql-hooks.md
@@ -1,6 +1,6 @@
---
name: graphql-hooks
-description: Minimal hooks-first GraphQL client.
+description: Minimal React hooks-first GraphQL client with a tiny bundle, SSR support and caching
url: https://github.com/nearform/graphql-hooks
github: nearform/graphql-hooks
npm: "graphql-hooks"
From 23ea1cfa3e43aa57941c415cd89abbc8990a6504 Mon Sep 17 00:00:00 2001
From: Simone Busoli
Date: Tue, 15 Dec 2020 11:17:28 +0100
Subject: [PATCH 064/439] Add graphql-hooks example
---
.../javascript/client/graphql-hooks.md | 63 +++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/src/content/code/language-support/javascript/client/graphql-hooks.md b/src/content/code/language-support/javascript/client/graphql-hooks.md
index eb0f43e526..0ae88803ac 100644
--- a/src/content/code/language-support/javascript/client/graphql-hooks.md
+++ b/src/content/code/language-support/javascript/client/graphql-hooks.md
@@ -5,3 +5,66 @@ url: https://github.com/nearform/graphql-hooks
github: nearform/graphql-hooks
npm: "graphql-hooks"
---
+
+- 🥇 First-class hooks API
+- ⚖️ _Tiny_ bundle: only 7.6kB (2.8 gzipped)
+- 📄 Full SSR support: see [graphql-hooks-ssr](packages/graphql-hooks-ssr)
+- 🔌 Plugin Caching: see [graphql-hooks-memcache](packages/graphql-hooks-memcache)
+- 🔥 No more render props hell
+- ⏳ Handle loading and error states with ease
+
+### Quickstart
+
+```bash
+npm install graphql-hooks
+```
+
+First you'll need to create a client and wrap your app with the provider:
+
+```js
+import { GraphQLClient, ClientContext } from 'graphql-hooks'
+
+const client = new GraphQLClient({
+ url: '/graphql'
+})
+
+function App() {
+ return (
+
+ {/* children */}
+
+ )
+}
+```
+
+Now in your child components you can make use of `useQuery`:
+
+```js
+import { useQuery } from 'graphql-hooks'
+
+const HOMEPAGE_QUERY = `query HomePage($limit: Int) {
+ users(limit: $limit) {
+ id
+ name
+ }
+}`
+
+function MyComponent() {
+ const { loading, error, data } = useQuery(HOMEPAGE_QUERY, {
+ variables: {
+ limit: 10
+ }
+ })
+
+ if (loading) return 'Loading...'
+ if (error) return 'Something Bad Happened'
+
+ return (
+
+ {frontendQuestions
+ .split(',')
+ .map(frontendQuestion => (
+
+ {frontendQuestion}
))
}
diff --git a/src/content/faq/General.md b/src/content/faq/General.md
index 515a44f6ba..ab91bc89da 100644
--- a/src/content/faq/General.md
+++ b/src/content/faq/General.md
@@ -3,7 +3,11 @@ title: Frequently Asked Questions (FAQ)
layout: faq
category: General
permalink: /faq/
-questions: Why should I use GraphQL?,Is GraphQL a database language like SQL?,Does GraphQL replace REST?,How can I learn GraphQL?,Is GraphQL frontend or backend?,Is GraphQL only for React or JavaScript developers?,What is a GraphQL client and why would I use one?,Is GraphQL owned by Facebook?,What is the GraphQL Foundation?,How can I contribute to the GraphQL specification?
+gettingStartedQuestions: Why should I use GraphQL?,Does GraphQL replace REST?,How can I learn GraphQL?,Is GraphQL a database language like SQL?,Is GraphQL only for React or JavaScript developers?
+generalQuestions: Is GraphQL frontend or backend?,Does GraphQL use HTTP?,How does GraphQL affect my product’s performance?,What is a GraphQL client and why would I use one?,Does GraphQL replace ORMs?,Is GraphQL owned by Facebook?,Who is behind GraphQL?,What is the GraphQL Foundation?
+bestPracticesQuestions: Is GraphQL scalable?,Does GraphQL support offline usage?,What are the security concerns with GraphQL?,How can I set up authorization with GraphQL?,How does authentication work with GraphQL?,Is GraphQL the right fit for designing a microservice architecture?,How does versioning work in GraphQL?,How can I document my GraphQL API?
+specificationQuestions: What is the best way to follow specification releases?,How can I contribute to the GraphQL specification?,Where is the documentation for subscriptions?
+frontendQuestions: Does GraphQL replace Redux or other state management libraries?
---
## Why should I use GraphQL?
@@ -20,14 +24,6 @@ It depends on your use case, but in general, GraphQL has a few key features that
You can try out GraphQL without rewriting your entire application. For instance, starting with a single HTTP request that wraps an existing REST call. Your [GraphQL schema](/learn/thinking-in-graphs/#shared-language) and [business domain model](/learn/thinking-in-graphs/#business-logic-layer) can expand gradually. We recommend focusing on one use case at first and only building the part of the schema needed for that.
-## Is GraphQL a database language like SQL?
-
-No, but this is a common misconception.
-
-GraphQL is a specification typically used for remote client-server communications. Unlike SQL, GraphQL is agnostic to the data source(s) used to retrieve data and persist changes. Accessing and manipulating data is performed with arbitrary functions called [resolvers](/learn/execution/). GraphQL coordinates and aggregates the data from these resolver functions, then returns the result to the client. Generally, these resolver functions should delegate to a [business logic layer](/learn/thinking-in-graphs/#business-logic-layer) responsible for communicating with the various underlying data sources. These data sources could be remote APIs, databases, [local cache](/learn/caching/), and nearly anything else your programming language can access.
-
-For more information on how to get GraphQL to interact with your database, check out our [documentation on resolvers](/learn/execution/#root-fields-resolvers).
-
## Does GraphQL replace REST?
No, not necessarily. They both handle APIs and can [serve similar purposes](/learn/thinking-in-graphs/#business-logic-layer) from a business perspective. GraphQL is often considered an alternative to REST, but it’s not a definitive replacement.
@@ -44,9 +40,13 @@ For more practical guides, visit the [How to GraphQL](https://www.howtographql.c
Before you start your learning journey, make sure you know [what an API is](https://www.codenewbie.org/blogs/an-intro-to-apis) and how communication generally works between client and server.
-## Is GraphQL frontend or backend?
+## Is GraphQL a database language like SQL?
-Both. GraphQL specifies how you can [exchange information between client and server](https://www.howtographql.com/basics/3-big-picture/). This includes how the server can indicate [what data and operations are available](/learn/introspection/), how the client should [format requests](/learn/queries/), how the server should [execute these queries](/learn/execution/), and what the client will [receive in response](/learn/serving-over-http/#response).
+No, but this is a common misconception.
+
+GraphQL is a specification typically used for remote client-server communications. Unlike SQL, GraphQL is agnostic to the data source(s) used to retrieve data and persist changes. Accessing and manipulating data is performed with arbitrary functions called [resolvers](/learn/execution/). GraphQL coordinates and aggregates the data from these resolver functions, then returns the result to the client. Generally, these resolver functions should delegate to a [business logic layer](/learn/thinking-in-graphs/#business-logic-layer) responsible for communicating with the various underlying data sources. These data sources could be remote APIs, databases, [local cache](/learn/caching/), and nearly anything else your programming language can access.
+
+For more information on how to get GraphQL to interact with your database, check out our [documentation on resolvers](/learn/execution/#root-fields-resolvers).
## Is GraphQL only for React or JavaScript developers?
@@ -54,6 +54,22 @@ No, not at all. [GraphQL is a specification](https://spec.graphql.org/) that can
It’s understandable why you’d think this, though. GraphQL was introduced at a [React conference](https://www.youtube.com/watch?v=9sc8Pyc51uU) and [GraphQL.js](/graphql-js/) is one of the most widely used implementations to date. We know this can be confusing, so we’re working to improve our documentation and add more code samples that aren’t written in JavaScript.
+## Is GraphQL frontend or backend?
+
+Both. GraphQL specifies how you can [exchange information between client and server](https://www.howtographql.com/basics/3-big-picture/). This includes how the server can indicate [what data and operations are available](/learn/introspection/), how the client should [format requests](/learn/queries/), how the server should [execute these queries](/learn/execution/), and what the client will [receive in response](/learn/serving-over-http/#response).
+
+## Does GraphQL use HTTP?
+
+Yes, [GraphQL is typically served over HTTP](/learn/best-practices/#http). This is largely due to how pervasive the HTTP protocol is in our industry. But it helps that you try out GraphQL by creating [a single HTTP request](#why-should-i-use-graphql). Guidelines for setting up a GraphQL server to operate over HTTP are available in our [Serving over HTTP](/learn/serving-over-http/) documentation.
+
+While HTTP is the most common choice for client-server protocol, it’s not the only one. GraphQL is agnostic to the transport layer. So, for example, you could use [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for GraphQL subscriptions instead of HTTP to consume realtime data.
+
+## How does GraphQL affect my product’s performance?
+
+On a typical GraphQL backend, every field on every type has a focused, single-purpose function for resolving that value. Also, instead of trying to handle data batching on the client, [GraphQL moves that logic to the server](/learn/best-practices/#server-side-batching-caching). As a result, there are some inherent performance benefits. Minimizing over-fetching and making [fewer roundtrips to the server](/learn/queries/#fields) are two of them.
+
+Other performance factors should be considered when building out your GraphQL implementation. For example, it’s possible for a GraphQL service to be ‘chatty’ and repeatedly load data from your database. This is commonly solved by [implementing a batching technique](/learn/best-practices/#server-side-batching-caching) or [utilizing a tool like DataLoader](https://github.com/graphql/dataloader).
+
## What is a GraphQL client and why would I use one?
GraphQL clients can help you handle [queries, mutations,](/learn/queries/) and [subscriptions](https://spec.graphql.org/draft/#sec-Subscription) to a [GraphQL server](https://www.howtographql.com/advanced/1-server/). They use the underlying structure of a GraphQL API to automate certain processes. This includes batching, UI updates, build-time schema validation, and more.
@@ -62,20 +78,106 @@ A list of GraphQL clients in various languages is available on our [Code page](/
You don't need a specific client to work with GraphQL, though. You might want to start out by [issuing GraphQL results with a regular HTTP client](/learn/serving-over-http/). Then later switch to a GraphQL-optimized client as your application grows in complexity.
+## Does GraphQL replace ORMs?
+
+No, GraphQL is a specification typically used for remote client-server communications. It's [agnostic to the data source(s) used](#is-graphql-a-database-language-like-sql) and doesn’t implement an object-relational mapping technique. But there are ORMs built specifically for GraphQL. A few of those are listed under the [Services section of our Code page](/code/#services).
+
## Is GraphQL owned by Facebook?
No, GraphQL is governed by the [GraphQL Foundation](#what-is-the-graphql-foundation).
That said, the specification was originally developed at Facebook and [Facebook is a member](https://foundation.graphql.org/members/) of the GraphQL Foundation. You might notice that some of our [GitHub repositories](https://github.com/graphql/) still have the license listed under Facebook Inc. We're updating those and have already converted major projects, like [GraphiQL](https://github.com/graphql/graphiql/blob/main/LICENSE) and [DataLoader](https://github.com/graphql/dataloader/blob/master/LICENSE), to the the new copyright: "Copyright (c) 2020 GraphQL Contributors."
+## Who is behind GraphQL?
+
+Many people! The [GraphQL specification and all related projects](http://github.com/graphql/) are open source, so anyone is welcome to [contribute](#how-can-i-contribute-to-the-specification). That said, there is a structure in place behind the repositories. This exists to resolve conflicts within the community and guiding technical decisions.
+
+The [GraphQL Foundation](#what-is-the-graphql-foundation) provides most of the oversight for GraphQL. It's made up of [representatives from dozens of different companies](https://foundation.graphql.org/members/).
+
+There are also monthly virtual [GraphQL Working Group (WG)](https://github.com/graphql/graphql-wg) meetings managed by the GraphQL Foundation. These meetings are designed to bring together maintainers of commonly used GraphQL libraries and tools, as well as significant contributors to the GraphQL community. The WG meetings are completely open. Anyone is able to join and [propose items to the agenda](https://github.com/graphql/graphql-wg/blob/master/agendas/).
+
+In the [November 2020 WG meeting](https://www.youtube.com/watch?v=UybZp9O24Ow), it was announced that GraphQL will have a Technical Steering Committee (TSC) going forward. More on that coming soon.
+
+If this is confusing, don’t worry - there’s a lot going on. To get a more visual, high-level overview, check out the [GraphQL Landscape](https://landscape.graphql.org/).
+
## What is the GraphQL Foundation?
The [GraphQL Foundation](https://foundation.graphql.org/faq/) is a neutral foundation that provides governance for GraphQL. This includes vendor-neutral oversight of open-source repositories, funding, events, and more. It's hosted under the [Linux Foundation](https://www.linuxfoundation.org/) and consists of [representatives from dozens of different companies](https://foundation.graphql.org/members/). The idea is that it’s an impartial and open home for the GraphQL community.
You can find out more by visiting [foundation.graphql.org](https://foundation.graphql.org/).
+## Is GraphQL scalable?
+
+Yes, GraphQL is designed to be scalable and is used by many companies in production under a very high load.
+
+GraphQL comes with some [built-in performance boosts](#how-does-graphql-affect-my-product-s-performance) that can help. But once you push it to production, you're responsible for scaling it across instances and monitoring performance.
+
+## Does GraphQL support offline usage?
+
+No, or at least not natively. But there are [GraphQL clients](#what-is-a-graphql-client-and-why-would-i-need-one) that enable you to build offline-first. They use features designed to perform data operations while offline, such as caching and service workers.
+
+You can find a list of GraphQL clients in various languages on our [Code page](/code/).
+
+## What are the security concerns with GraphQL?
+
+Most of the security concerns associated with GraphQL are typical for any API or service. A few examples: SQL injections, Denial of Service (DoS) attacks, or someone abusing flawed authentication. But there are also some attacks specific to GraphQL. For instance, [batching attacks](https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html#batching-attacks). These attacks can happen as a result of GraphQL allowing you to batch multiple queries (or requests for multiple object instances) in a single network call.
+
+No matter the concern, it’s important to be proactive. There are many ways to securing your GraphQL server. Using a timeout, setting a maximum depth for queries, and throttling queries based on the server time it needs to complete are all potential approaches.
+
+For an overview of common security concerns and how to address them, check out the [Security tutorial on How to GraphQL](https://www.howtographql.com/advanced/4-security/) and [OWASP’s GraphQL Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html).
+
+## How can I set up authorization with GraphQL?
+
+We recommend enforcing authorization behavior in the [business logic layer](/learn/thinking-in-graphs/#business-logic-layer). That way, you have a single source of truth for authorization.
+
+For a more detailed explanation, go to our [Authorization documentation](/learn/authorization/).
+
+## How does authentication work with GraphQL?
+
+You can implement authentication with common patterns, such as [OAuth](https://oauth.net/) or [JWT](https://jwt.io/). There’s nothing special about authentication within the GraphQL specification.
+
+Some [GraphQL libraries](/code/#language-support) include a specific protocol for authentication as well. Although if you’re working with a pipeline model, we recommend that [GraphQL be placed after all authentication middleware](/learn/serving-over-http/#web-request-pipeline).
+
+If you’re using [GraphQL.js](/graphql-js/) to build your API server, we have documentation on [handling authentication with Express middleware](/graphql-js/authentication-and-express-middleware/).
+
+## Is GraphQL the right fit for designing a microservice architecture?
+
+Yes, it can be. If you’re integrating GraphQL into your microservice architecture, we’d recommend having one GraphQL schema as an API gateway rather than having your client talk to multiple GraphQL services. This way, you can split your backend into microservices, but then still aggregate all your data to the frontend from a single API.
+
+There are many ways to create an API gateway. The benefit of using GraphQL is that you can take advantage of features like [caching](/learn/caching/), request budgeting, and planning out query schedules.
+
+## How does versioning work in GraphQL?
+
+There’s nothing that will prevent a GraphQL service from being versioned like any other REST API. That said, GraphQL avoids versioning by design. Instead, GraphQL provides the tools to continually build and evolve your schema. For example, GraphQL only returns the data that’s explicitly requested. This means that you can add new features (and all the associated types and fields) without creating a breaking change or bloating results for existing queries.
+
+You can read more about [how versioning works in GraphQL](/learn/best-practices/#versioning) in our Best Practices section.
+
+## How can I document my GraphQL API?
+
+One of the benefits of GraphQL is that it's inherently self-documenting. This means that when you use an interactive tool like [GraphiQL](https://github.com/graphql/graphiql), you’re able to explore what data is exposed by your GraphQL API. This includes the [fields](/learn/queries/#fields), [types](/learn/schema/#type-system), and more. You can also add a [description field](https://spec.graphql.org/draft/#sec-Documentation) to provide supplementary notes about your endpoint. This description field supports strings and Markdown.
+
+For many, this provides enough API reference documentation. But it doesn’t reduce the need for other forms of documentation. You'll likely still need to create guides that explain how the general concepts tie into your specific use case.
+
+## What is the best way to follow specification releases?
+
+The latest working draft release of the GraphQL specification can be found at [spec.graphql.org/draft](https://spec.graphql.org/draft/). Previous editions are also available at permalinks that match their [release tag](https://github.com/graphql/graphql-spec/releases).
+
+The entire process behind each release is open source. You can monitor specification proposals by following [pull requests in the graphql-spec repository](https://github.com/graphql/graphql-spec/pulls). You can also watch past GraphQL Working Group discussions various proposals on [YouTube](https://www.youtube.com/channel/UCERcwLeheOXp_u61jEXxHMA).
+
## How can I contribute to the GraphQL specification?
GraphQL is still evolving and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub.
There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation).
+
+## Where is the documentation for subscriptions?
+
+It's not on this website yet, but we're working on it. For now, the specification includes details for [how to write and execute subscriptions](https://spec.graphql.org/draft/#sec-Subscription).
+
+If you'd like to help write guides on subscriptions, please [let us know](https://github.com/graphql/graphql.github.io/issues/993).
+
+## Does GraphQL replace Redux or other state management libraries?
+
+No, GraphQL isn’t a state management library - but it can reduce the need for one.
+
+One benefit of state management libraries like Redux is that they can manipulate API responses into a format that your application understands. With GraphQL, you have control over [what data you request](/learn/queries/#fields) and typically results are formatted in a client-friendly way by the graph design. So this benefit is already built-in. Many [client libraries](#what-is-a-graphql-client-and-why-would-i-need-one) can also be used to manage state and have features like caching built-in. You may still decide to implement a state management library, but using it to format response data is generally not necessary.
diff --git a/src/templates/doc.tsx b/src/templates/doc.tsx
index d179668dfa..054278a9a3 100644
--- a/src/templates/doc.tsx
+++ b/src/templates/doc.tsx
@@ -21,7 +21,7 @@ const layoutMap: any = {
const Blog = ({ data, pageContext }: Props) => {
const {
doc: {
- frontmatter: { title, date, permalink, byline, guestBio, layout, questions },
+ frontmatter: { title, date, permalink, byline, guestBio, layout, gettingStartedQuestions, generalQuestions, bestPracticesQuestions, specificationQuestions, frontendQuestions },
rawMarkdownBody,
},
nextDoc,
@@ -35,7 +35,11 @@ const Blog = ({ data, pageContext }: Props) => {
permalink={permalink}
byline={byline}
guestBio={guestBio}
- questions={questions}
+ gettingStartedQuestions={gettingStartedQuestions}
+ generalQuestions={generalQuestions}
+ bestPracticesQuestions={bestPracticesQuestions}
+ specificationQuestions={specificationQuestions}
+ frontendQuestions={frontendQuestions}
rawMarkdownBody={rawMarkdownBody}
nextDoc={nextDoc}
sideBarData={pageContext.sideBarData}
@@ -56,7 +60,11 @@ export const query = graphql`
guestBio
sublinks
layout
- questions
+ gettingStartedQuestions
+ generalQuestions
+ bestPracticesQuestions
+ specificationQuestions
+ frontendQuestions
}
id
rawMarkdownBody
From faa2d44af1817672bad22f023b61c1d842f9b383 Mon Sep 17 00:00:00 2001
From: Carolyn Stransky
Date: Mon, 21 Dec 2020 22:19:25 +0100
Subject: [PATCH 066/439] Implement new accordion design for FAQ page (#985)
* Initial commit new FAQ design
* Finally something rendering
* Add sidebar
* Jk remove the sidebar again
* Add useAccordion hook
* Move FAQ specific CSS into its own less file
* Fix scrolling issue and keyboard accessibility
* Workaround for gatsby build error
* Remove broken transitions
* Update based on code review in #982
---
src/assets/css/_css/docs.less | 5 -
src/assets/css/_css/faq.less | 94 ++++++++++++++++++
src/assets/css/style.less | 1 +
src/components/FAQLayout/index.tsx | 92 +++--------------
src/components/FAQSection/index.tsx | 21 ++++
src/content/faq/BestPractices.md | 60 +++++++++++
src/content/faq/Frontend.md | 12 +++
src/content/faq/General.md | 149 +++-------------------------
src/content/faq/GettingStarted.md | 50 ++++++++++
src/content/faq/Specification.md | 24 +++++
src/pages/faq.tsx | 70 +++++++++++++
src/templates/doc.tsx | 12 +--
src/utils/useFAQAccordion.ts | 83 ++++++++++++++++
13 files changed, 441 insertions(+), 232 deletions(-)
create mode 100644 src/assets/css/_css/faq.less
create mode 100644 src/components/FAQSection/index.tsx
create mode 100644 src/content/faq/BestPractices.md
create mode 100644 src/content/faq/Frontend.md
create mode 100644 src/content/faq/GettingStarted.md
create mode 100644 src/content/faq/Specification.md
create mode 100644 src/pages/faq.tsx
create mode 100644 src/utils/useFAQAccordion.ts
diff --git a/src/assets/css/_css/docs.less b/src/assets/css/_css/docs.less
index 963887fab2..0ad08aa862 100644
--- a/src/assets/css/_css/docs.less
+++ b/src/assets/css/_css/docs.less
@@ -162,11 +162,6 @@
}
}
- .faq-questions::before {
- content: "\A";
- white-space: pre;
- }
-
img {
max-width: 100%;
}
diff --git a/src/assets/css/_css/faq.less b/src/assets/css/_css/faq.less
new file mode 100644
index 0000000000..d6375cebf4
--- /dev/null
+++ b/src/assets/css/_css/faq.less
@@ -0,0 +1,94 @@
+.inner-faq-content {
+ flex: 1;
+ @media screen and (max-width: 740px) {
+ margin-right: 0;
+ }
+
+ & > h1:first-child {
+ margin-top: 1em;
+ }
+
+ h2 {
+ margin-bottom: 10px;
+ }
+
+ .faq-button-question {
+ background: transparent;
+ display: block;
+ width: 100%;
+ text-align: left;
+ padding: 0;
+ cursor: pointer;
+ box-shadow: 0px -1px 0px #aaa;
+
+ &:first-child {
+ box-shadow: none;
+ }
+ }
+
+ h3 {
+ color: #e10098;
+ padding: 20px 0 20px 5px;
+ margin: 0;
+ user-select: none;
+ position: relative;
+
+ &.open:after {
+ transform: rotate(-45deg);
+ }
+
+ &:after {
+ content: "";
+ height: 33px;
+ width: 33px;
+ background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125"%3E%3Cpath height="20px" width="20px" style="text-indent:0;text-transform:none;block-progression:tb" d="M50 13a4 4 0 00-4 4v29H17a4 4 0 000 8h29v29a4 4 0 108 0V54h29a4 4 0 100-8H54V17a4 4 0 00-4-4z" overflow="visible" fill="%23aaa"/%3E%3C/svg%3E%0A');
+ background-repeat: no-repeat;
+ position: absolute;
+ transition: transform 200ms ease;
+ right: 0;
+
+ @media screen and (max-width: 768px) {
+ display: none;
+ }
+ }
+
+ a {
+ clip: rect(0 0 0 0);
+ clip-path: inset(50%);
+ height: 1px;
+ overflow: hidden;
+ position: absolute;
+ white-space: nowrap;
+ width: 1px;
+ }
+ }
+
+ ul {
+ max-height: 0;
+ opacity: 0;
+ margin-bottom: 0;
+ margin-top: 0;
+ display: none;
+
+ &.show {
+ opacity: 1;
+ max-height: 800px;
+ margin-bottom: 1.0875rem;
+ display: block;
+ }
+ }
+
+ p {
+ max-height: 0;
+ opacity: 0;
+ margin: 0;
+ display: none;
+
+ &.show {
+ opacity: 1;
+ max-height: 400px;
+ margin-bottom: 1.0875rem;
+ display: block;
+ }
+ }
+}
diff --git a/src/assets/css/style.less b/src/assets/css/style.less
index 44741808d3..041e5f9f28 100644
--- a/src/assets/css/style.less
+++ b/src/assets/css/style.less
@@ -6,3 +6,4 @@
@import "_css/codemirror.less";
@import "_css/algolia.less";
@import "_css/code.less";
+@import "_css/faq.less";
diff --git a/src/components/FAQLayout/index.tsx b/src/components/FAQLayout/index.tsx
index ce8a21f959..d3f3df6f71 100644
--- a/src/components/FAQLayout/index.tsx
+++ b/src/components/FAQLayout/index.tsx
@@ -1,94 +1,28 @@
import React from "react"
-import { Link } from "gatsby"
-import Marked from '../Marked'
-import { toSlug } from '../../utils/slug'
+import FAQSection from "../FAQSection"
interface Props {
title: string
- gettingStartedQuestions: string
- generalQuestions: string
- bestPracticesQuestions: string
- specificationQuestions: string
- frontendQuestions: string
rawMarkdownBody: string
+ pageContext: any
}
-const index = ({ title, gettingStartedQuestions, generalQuestions, bestPracticesQuestions, specificationQuestions, frontendQuestions, rawMarkdownBody }: Props) => {
+const index = ({
+ title,
+ rawMarkdownBody,
+ pageContext
+}: Props) => {
return (
)
}
-export default index
+export default index
\ No newline at end of file
diff --git a/src/components/FAQSection/index.tsx b/src/components/FAQSection/index.tsx
new file mode 100644
index 0000000000..9c23d26c38
--- /dev/null
+++ b/src/components/FAQSection/index.tsx
@@ -0,0 +1,21 @@
+import React from "react"
+import Marked from "../Marked"
+
+interface Props {
+ title: string
+ rawMarkdownBody: string
+ pageContext: any
+}
+
+const FAQSection = ({
+ title,
+ rawMarkdownBody,
+ pageContext
+}: Props) => (
+
+
{title}
+ {rawMarkdownBody}
+
+)
+
+export default FAQSection
diff --git a/src/content/faq/BestPractices.md b/src/content/faq/BestPractices.md
new file mode 100644
index 0000000000..c01e0e6a78
--- /dev/null
+++ b/src/content/faq/BestPractices.md
@@ -0,0 +1,60 @@
+---
+title: Best Practices
+layout: faq
+permalink: /faq/best-practices
+position: 3
+---
+
+### Is GraphQL scalable?
+
+Yes, GraphQL is designed to be scalable and is used by many companies in production under a very high load.
+
+GraphQL comes with some [built-in performance boosts](#how-does-graphql-affect-my-product-s-performance) that can help. But once you push it to production, you're responsible for scaling it across instances and monitoring performance.
+
+### Does GraphQL support offline usage?
+
+No, or at least not natively. But there are [GraphQL clients](#what-is-a-graphql-client-and-why-would-i-need-one) that enable you to build offline-first. They use features designed to perform data operations while offline, such as caching and service workers.
+
+You can find a list of GraphQL clients in various languages on our [Code page](/code/).
+
+### What are the security concerns with GraphQL?
+
+Most of the security concerns associated with GraphQL are typical for any API or service. A few examples: SQL injections, Denial of Service (DoS) attacks, or someone abusing flawed authentication. But there are also some attacks specific to GraphQL. For instance, [batching attacks](https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html#batching-attacks). These attacks can happen as a result of GraphQL allowing you to batch multiple queries (or requests for multiple object instances) in a single network call.
+
+No matter the concern, it’s important to be proactive. There are many ways to securing your GraphQL server. Using a timeout, setting a maximum depth for queries, and throttling queries based on the server time it needs to complete are all potential approaches.
+
+For an overview of common security concerns and how to address them, check out the [Security tutorial on How to GraphQL](https://www.howtographql.com/advanced/4-security/) and [OWASP’s GraphQL Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html).
+
+### How can I set up authorization with GraphQL?
+
+We recommend enforcing authorization behavior in the [business logic layer](/learn/thinking-in-graphs/#business-logic-layer). That way, you have a single source of truth for authorization.
+
+For a more detailed explanation, go to our [Authorization documentation](/learn/authorization/).
+
+### How does authentication work with GraphQL?
+
+You can implement authentication with common patterns, such as [OAuth](https://oauth.net/) or [JWT](https://jwt.io/). There’s nothing special about authentication within the GraphQL specification.
+
+Some [GraphQL libraries](/code/#language-support) include a specific protocol for authentication as well. Although if you’re working with a pipeline model, we recommend that [GraphQL be placed after all authentication middleware](/learn/serving-over-http/#web-request-pipeline).
+
+If you’re using [GraphQL.js](/graphql-js/) to build your API server, we have documentation on [handling authentication with Express middleware](/graphql-js/authentication-and-express-middleware/).
+
+### Is GraphQL the right fit for designing a microservice architecture?
+
+Yes, it can be. If you’re integrating GraphQL into your microservice architecture, we’d recommend having one GraphQL schema as an API gateway rather than having your client talk to multiple GraphQL services. This way, you can split your backend into microservices, but then still aggregate all your data to the frontend from a single API.
+
+There are many ways to create an API gateway. The benefit of using GraphQL is that you can take advantage of features like [caching](/learn/caching/), request budgeting, and planning out query schedules.
+
+### How does versioning work in GraphQL?
+
+There’s nothing that will prevent a GraphQL service from being versioned like any other REST API. That said, GraphQL avoids versioning by design.
+
+Instead, GraphQL provides the tools to continually build and evolve your schema. For example, GraphQL only returns the data that’s explicitly requested. This means that you can add new features (and all the associated types and fields) without creating a breaking change or bloating results for existing queries.
+
+You can read more about [how versioning works in GraphQL](/learn/best-practices/#versioning) in our Best Practices section.
+
+### How can I document my GraphQL API?
+
+One of the benefits of GraphQL is that it's inherently self-documenting. This means that when you use an interactive tool like [GraphiQL](https://github.com/graphql/graphiql), you’re able to explore what data is exposed by your GraphQL API. This includes the [fields](/learn/queries/#fields), [types](/learn/schema/#type-system), and more. You can also add a [description field](https://spec.graphql.org/draft/#sec-Documentation) to provide supplementary notes about your endpoint. This description field supports strings and Markdown.
+
+For many, this provides enough API reference documentation. But it doesn’t reduce the need for other forms of documentation. You'll likely still need to create guides that explain how the general concepts tie into your specific use case.
\ No newline at end of file
diff --git a/src/content/faq/Frontend.md b/src/content/faq/Frontend.md
new file mode 100644
index 0000000000..ce7d9d805c
--- /dev/null
+++ b/src/content/faq/Frontend.md
@@ -0,0 +1,12 @@
+---
+title: Frontend
+layout: faq
+permalink: /faq/frontend
+position: 5
+---
+
+### Does GraphQL replace Redux or other state management libraries?
+
+No, GraphQL isn’t a state management library - but it can reduce the need for one.
+
+One benefit of state management libraries like Redux is that they can manipulate API responses into a format that your application understands. With GraphQL, you have control over [what data you request](/learn/queries/#fields) and typically results are formatted in a client-friendly way by the graph design. So this benefit is already built-in. Many [client libraries](#what-is-a-graphql-client-and-why-would-i-need-one) can also be used to manage state and have features like caching built-in. You may still decide to implement a state management library, but using it to format response data is generally not necessary.
\ No newline at end of file
diff --git a/src/content/faq/General.md b/src/content/faq/General.md
index ab91bc89da..496f7424cd 100644
--- a/src/content/faq/General.md
+++ b/src/content/faq/General.md
@@ -1,76 +1,27 @@
---
-title: Frequently Asked Questions (FAQ)
+title: General
layout: faq
-category: General
-permalink: /faq/
-gettingStartedQuestions: Why should I use GraphQL?,Does GraphQL replace REST?,How can I learn GraphQL?,Is GraphQL a database language like SQL?,Is GraphQL only for React or JavaScript developers?
-generalQuestions: Is GraphQL frontend or backend?,Does GraphQL use HTTP?,How does GraphQL affect my product’s performance?,What is a GraphQL client and why would I use one?,Does GraphQL replace ORMs?,Is GraphQL owned by Facebook?,Who is behind GraphQL?,What is the GraphQL Foundation?
-bestPracticesQuestions: Is GraphQL scalable?,Does GraphQL support offline usage?,What are the security concerns with GraphQL?,How can I set up authorization with GraphQL?,How does authentication work with GraphQL?,Is GraphQL the right fit for designing a microservice architecture?,How does versioning work in GraphQL?,How can I document my GraphQL API?
-specificationQuestions: What is the best way to follow specification releases?,How can I contribute to the GraphQL specification?,Where is the documentation for subscriptions?
-frontendQuestions: Does GraphQL replace Redux or other state management libraries?
+permalink: /faq/general
+position: 2
---
-## Why should I use GraphQL?
-
-It depends on your use case, but in general, GraphQL has a few key features that stand out. For example, GraphQL enables you to:
-
-* Aggregate data from [multiple UI components](/learn/queries/#fragments).
-* Create a representation of your data that feels familiar and natural ([a graph](/learn/thinking-in-graphs/#it-s-graphs-all-the-way-down)).
-* Ensure that all of your data is [statically typed](/learn/schema/) and these types inform [what queries the schema supports](/learn/introspection/).
-* [Reduce the need for breaking changes](/learn/best-practices/#versioning), but utilize a [built-in mechanism for deprecations](https://spec.graphql.org/draft/#sec-Deprecation) when you need to.
-* Access to a [powerful tooling ecosystem](/code/#generic-tools) with GUIs, editor integrations, code generation, linting, analytics, and more.
-
-[Our homepage](/) outlines even more reasons to use GraphQL.
-
-You can try out GraphQL without rewriting your entire application. For instance, starting with a single HTTP request that wraps an existing REST call. Your [GraphQL schema](/learn/thinking-in-graphs/#shared-language) and [business domain model](/learn/thinking-in-graphs/#business-logic-layer) can expand gradually. We recommend focusing on one use case at first and only building the part of the schema needed for that.
-
-## Does GraphQL replace REST?
-
-No, not necessarily. They both handle APIs and can [serve similar purposes](/learn/thinking-in-graphs/#business-logic-layer) from a business perspective. GraphQL is often considered an alternative to REST, but it’s not a definitive replacement.
-
-GraphQL and REST can actually co-exist in your stack. For example, you can abstract REST APIs behind a [GraphQL server](https://www.howtographql.com/advanced/1-server/). This can be done by masking your REST endpoint into a GraphQL endpoint using [root resolvers](/learn/execution/#root-fields-resolvers).
-
-For an opinionated perspective on how GraphQL compares to REST, check out [How To GraphQL](https://www.howtographql.com/basics/1-graphql-is-the-better-rest/).
-
-## How can I learn GraphQL?
-
-There are many resources available to help you learn GraphQL, including this website. In [our documentation](/learn/), you’ll find a series of articles that explain essential GraphQL concepts and how they work. Our [Community page](/community) is full of resources to reference and groups to join.
-
-For more practical guides, visit the [How to GraphQL](https://www.howtographql.com/) fullstack tutorial website. We also have a free online course with edX, [Exploring GraphQL: A Query Language for APIs](https://www.edx.org/course/exploring-graphql-a-query-language-for-apis).
-
-Before you start your learning journey, make sure you know [what an API is](https://www.codenewbie.org/blogs/an-intro-to-apis) and how communication generally works between client and server.
-
-## Is GraphQL a database language like SQL?
-
-No, but this is a common misconception.
-
-GraphQL is a specification typically used for remote client-server communications. Unlike SQL, GraphQL is agnostic to the data source(s) used to retrieve data and persist changes. Accessing and manipulating data is performed with arbitrary functions called [resolvers](/learn/execution/). GraphQL coordinates and aggregates the data from these resolver functions, then returns the result to the client. Generally, these resolver functions should delegate to a [business logic layer](/learn/thinking-in-graphs/#business-logic-layer) responsible for communicating with the various underlying data sources. These data sources could be remote APIs, databases, [local cache](/learn/caching/), and nearly anything else your programming language can access.
-
-For more information on how to get GraphQL to interact with your database, check out our [documentation on resolvers](/learn/execution/#root-fields-resolvers).
-
-## Is GraphQL only for React or JavaScript developers?
-
-No, not at all. [GraphQL is a specification](https://spec.graphql.org/) that can be [implemented in any language](/learn/schema/#type-language). Our [Code page](/code/) contains a long list of libraries in many different programming languages to help with that.
-
-It’s understandable why you’d think this, though. GraphQL was introduced at a [React conference](https://www.youtube.com/watch?v=9sc8Pyc51uU) and [GraphQL.js](/graphql-js/) is one of the most widely used implementations to date. We know this can be confusing, so we’re working to improve our documentation and add more code samples that aren’t written in JavaScript.
-
-## Is GraphQL frontend or backend?
+### Is GraphQL frontend or backend?
Both. GraphQL specifies how you can [exchange information between client and server](https://www.howtographql.com/basics/3-big-picture/). This includes how the server can indicate [what data and operations are available](/learn/introspection/), how the client should [format requests](/learn/queries/), how the server should [execute these queries](/learn/execution/), and what the client will [receive in response](/learn/serving-over-http/#response).
-## Does GraphQL use HTTP?
+### Does GraphQL use HTTP?
-Yes, [GraphQL is typically served over HTTP](/learn/best-practices/#http). This is largely due to how pervasive the HTTP protocol is in our industry. But it helps that you try out GraphQL by creating [a single HTTP request](#why-should-i-use-graphql). Guidelines for setting up a GraphQL server to operate over HTTP are available in our [Serving over HTTP](/learn/serving-over-http/) documentation.
+Yes, [GraphQL is typically served over HTTP](/learn/best-practices/#http). This is largely due to how pervasive the HTTP protocol is in our industry. But it helps that you can try out GraphQL by creating [a single HTTP request](#why-should-i-use-graphql). Guidelines for setting up a GraphQL server to operate over HTTP are available in our [Serving over HTTP](/learn/serving-over-http/) documentation.
While HTTP is the most common choice for client-server protocol, it’s not the only one. GraphQL is agnostic to the transport layer. So, for example, you could use [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for GraphQL subscriptions instead of HTTP to consume realtime data.
-## How does GraphQL affect my product’s performance?
+### How does GraphQL affect my product’s performance?
On a typical GraphQL backend, every field on every type has a focused, single-purpose function for resolving that value. Also, instead of trying to handle data batching on the client, [GraphQL moves that logic to the server](/learn/best-practices/#server-side-batching-caching). As a result, there are some inherent performance benefits. Minimizing over-fetching and making [fewer roundtrips to the server](/learn/queries/#fields) are two of them.
Other performance factors should be considered when building out your GraphQL implementation. For example, it’s possible for a GraphQL service to be ‘chatty’ and repeatedly load data from your database. This is commonly solved by [implementing a batching technique](/learn/best-practices/#server-side-batching-caching) or [utilizing a tool like DataLoader](https://github.com/graphql/dataloader).
-## What is a GraphQL client and why would I use one?
+### What is a GraphQL client and why would I use one?
GraphQL clients can help you handle [queries, mutations,](/learn/queries/) and [subscriptions](https://spec.graphql.org/draft/#sec-Subscription) to a [GraphQL server](https://www.howtographql.com/advanced/1-server/). They use the underlying structure of a GraphQL API to automate certain processes. This includes batching, UI updates, build-time schema validation, and more.
@@ -78,17 +29,17 @@ A list of GraphQL clients in various languages is available on our [Code page](/
You don't need a specific client to work with GraphQL, though. You might want to start out by [issuing GraphQL results with a regular HTTP client](/learn/serving-over-http/). Then later switch to a GraphQL-optimized client as your application grows in complexity.
-## Does GraphQL replace ORMs?
+### Does GraphQL replace ORMs?
No, GraphQL is a specification typically used for remote client-server communications. It's [agnostic to the data source(s) used](#is-graphql-a-database-language-like-sql) and doesn’t implement an object-relational mapping technique. But there are ORMs built specifically for GraphQL. A few of those are listed under the [Services section of our Code page](/code/#services).
-## Is GraphQL owned by Facebook?
+### Is GraphQL owned by Facebook?
No, GraphQL is governed by the [GraphQL Foundation](#what-is-the-graphql-foundation).
That said, the specification was originally developed at Facebook and [Facebook is a member](https://foundation.graphql.org/members/) of the GraphQL Foundation. You might notice that some of our [GitHub repositories](https://github.com/graphql/) still have the license listed under Facebook Inc. We're updating those and have already converted major projects, like [GraphiQL](https://github.com/graphql/graphiql/blob/main/LICENSE) and [DataLoader](https://github.com/graphql/dataloader/blob/master/LICENSE), to the the new copyright: "Copyright (c) 2020 GraphQL Contributors."
-## Who is behind GraphQL?
+### Who is behind GraphQL?
Many people! The [GraphQL specification and all related projects](http://github.com/graphql/) are open source, so anyone is welcome to [contribute](#how-can-i-contribute-to-the-specification). That said, there is a structure in place behind the repositories. This exists to resolve conflicts within the community and guiding technical decisions.
@@ -100,84 +51,8 @@ In the [November 2020 WG meeting](https://www.youtube.com/watch?v=UybZp9O24Ow),
If this is confusing, don’t worry - there’s a lot going on. To get a more visual, high-level overview, check out the [GraphQL Landscape](https://landscape.graphql.org/).
-## What is the GraphQL Foundation?
+### What is the GraphQL Foundation?
The [GraphQL Foundation](https://foundation.graphql.org/faq/) is a neutral foundation that provides governance for GraphQL. This includes vendor-neutral oversight of open-source repositories, funding, events, and more. It's hosted under the [Linux Foundation](https://www.linuxfoundation.org/) and consists of [representatives from dozens of different companies](https://foundation.graphql.org/members/). The idea is that it’s an impartial and open home for the GraphQL community.
You can find out more by visiting [foundation.graphql.org](https://foundation.graphql.org/).
-
-## Is GraphQL scalable?
-
-Yes, GraphQL is designed to be scalable and is used by many companies in production under a very high load.
-
-GraphQL comes with some [built-in performance boosts](#how-does-graphql-affect-my-product-s-performance) that can help. But once you push it to production, you're responsible for scaling it across instances and monitoring performance.
-
-## Does GraphQL support offline usage?
-
-No, or at least not natively. But there are [GraphQL clients](#what-is-a-graphql-client-and-why-would-i-need-one) that enable you to build offline-first. They use features designed to perform data operations while offline, such as caching and service workers.
-
-You can find a list of GraphQL clients in various languages on our [Code page](/code/).
-
-## What are the security concerns with GraphQL?
-
-Most of the security concerns associated with GraphQL are typical for any API or service. A few examples: SQL injections, Denial of Service (DoS) attacks, or someone abusing flawed authentication. But there are also some attacks specific to GraphQL. For instance, [batching attacks](https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html#batching-attacks). These attacks can happen as a result of GraphQL allowing you to batch multiple queries (or requests for multiple object instances) in a single network call.
-
-No matter the concern, it’s important to be proactive. There are many ways to securing your GraphQL server. Using a timeout, setting a maximum depth for queries, and throttling queries based on the server time it needs to complete are all potential approaches.
-
-For an overview of common security concerns and how to address them, check out the [Security tutorial on How to GraphQL](https://www.howtographql.com/advanced/4-security/) and [OWASP’s GraphQL Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html).
-
-## How can I set up authorization with GraphQL?
-
-We recommend enforcing authorization behavior in the [business logic layer](/learn/thinking-in-graphs/#business-logic-layer). That way, you have a single source of truth for authorization.
-
-For a more detailed explanation, go to our [Authorization documentation](/learn/authorization/).
-
-## How does authentication work with GraphQL?
-
-You can implement authentication with common patterns, such as [OAuth](https://oauth.net/) or [JWT](https://jwt.io/). There’s nothing special about authentication within the GraphQL specification.
-
-Some [GraphQL libraries](/code/#language-support) include a specific protocol for authentication as well. Although if you’re working with a pipeline model, we recommend that [GraphQL be placed after all authentication middleware](/learn/serving-over-http/#web-request-pipeline).
-
-If you’re using [GraphQL.js](/graphql-js/) to build your API server, we have documentation on [handling authentication with Express middleware](/graphql-js/authentication-and-express-middleware/).
-
-## Is GraphQL the right fit for designing a microservice architecture?
-
-Yes, it can be. If you’re integrating GraphQL into your microservice architecture, we’d recommend having one GraphQL schema as an API gateway rather than having your client talk to multiple GraphQL services. This way, you can split your backend into microservices, but then still aggregate all your data to the frontend from a single API.
-
-There are many ways to create an API gateway. The benefit of using GraphQL is that you can take advantage of features like [caching](/learn/caching/), request budgeting, and planning out query schedules.
-
-## How does versioning work in GraphQL?
-
-There’s nothing that will prevent a GraphQL service from being versioned like any other REST API. That said, GraphQL avoids versioning by design. Instead, GraphQL provides the tools to continually build and evolve your schema. For example, GraphQL only returns the data that’s explicitly requested. This means that you can add new features (and all the associated types and fields) without creating a breaking change or bloating results for existing queries.
-
-You can read more about [how versioning works in GraphQL](/learn/best-practices/#versioning) in our Best Practices section.
-
-## How can I document my GraphQL API?
-
-One of the benefits of GraphQL is that it's inherently self-documenting. This means that when you use an interactive tool like [GraphiQL](https://github.com/graphql/graphiql), you’re able to explore what data is exposed by your GraphQL API. This includes the [fields](/learn/queries/#fields), [types](/learn/schema/#type-system), and more. You can also add a [description field](https://spec.graphql.org/draft/#sec-Documentation) to provide supplementary notes about your endpoint. This description field supports strings and Markdown.
-
-For many, this provides enough API reference documentation. But it doesn’t reduce the need for other forms of documentation. You'll likely still need to create guides that explain how the general concepts tie into your specific use case.
-
-## What is the best way to follow specification releases?
-
-The latest working draft release of the GraphQL specification can be found at [spec.graphql.org/draft](https://spec.graphql.org/draft/). Previous editions are also available at permalinks that match their [release tag](https://github.com/graphql/graphql-spec/releases).
-
-The entire process behind each release is open source. You can monitor specification proposals by following [pull requests in the graphql-spec repository](https://github.com/graphql/graphql-spec/pulls). You can also watch past GraphQL Working Group discussions various proposals on [YouTube](https://www.youtube.com/channel/UCERcwLeheOXp_u61jEXxHMA).
-
-## How can I contribute to the GraphQL specification?
-
-GraphQL is still evolving and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub.
-
-There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation).
-
-## Where is the documentation for subscriptions?
-
-It's not on this website yet, but we're working on it. For now, the specification includes details for [how to write and execute subscriptions](https://spec.graphql.org/draft/#sec-Subscription).
-
-If you'd like to help write guides on subscriptions, please [let us know](https://github.com/graphql/graphql.github.io/issues/993).
-
-## Does GraphQL replace Redux or other state management libraries?
-
-No, GraphQL isn’t a state management library - but it can reduce the need for one.
-
-One benefit of state management libraries like Redux is that they can manipulate API responses into a format that your application understands. With GraphQL, you have control over [what data you request](/learn/queries/#fields) and typically results are formatted in a client-friendly way by the graph design. So this benefit is already built-in. Many [client libraries](#what-is-a-graphql-client-and-why-would-i-need-one) can also be used to manage state and have features like caching built-in. You may still decide to implement a state management library, but using it to format response data is generally not necessary.
diff --git a/src/content/faq/GettingStarted.md b/src/content/faq/GettingStarted.md
new file mode 100644
index 0000000000..1c9628ce8e
--- /dev/null
+++ b/src/content/faq/GettingStarted.md
@@ -0,0 +1,50 @@
+---
+title: Getting Started
+layout: faq
+permalink: /faq/getting-started
+position: 1
+---
+
+### Why should I use GraphQL?
+
+It depends on your use case, but in general, GraphQL has a few key features that stand out. For example, GraphQL enables you to:
+
+* Aggregate data from [multiple UI components](/learn/queries/#fragments).
+* Create a representation of your data that feels familiar and natural ([a graph](/learn/thinking-in-graphs/#it-s-graphs-all-the-way-down)).
+* Ensure that all of your data is [statically typed](/learn/schema/) and these types inform [what queries the schema supports](/learn/introspection/).
+* [Reduce the need for breaking changes](/learn/best-practices/#versioning), but utilize a [built-in mechanism for deprecations](https://spec.graphql.org/draft/#sec-Deprecation) when you need to.
+* Access to a [powerful tooling ecosystem](/code/#generic-tools) with GUIs, editor integrations, code generation, linting, analytics, and more.
+
+[Our homepage](/) outlines even more reasons to use GraphQL.
+
+You can try out GraphQL without rewriting your entire application. For instance, starting with a single HTTP request that wraps an existing REST call. Your [GraphQL schema](/learn/thinking-in-graphs/#shared-language) and [business domain model](/learn/thinking-in-graphs/#business-logic-layer) can expand gradually. We recommend focusing on one use case at first and only building the part of the schema needed for that.
+
+### Does GraphQL replace REST?
+
+No, not necessarily. They both handle APIs and can [serve similar purposes](/learn/thinking-in-graphs/#business-logic-layer) from a business perspective. GraphQL is often considered an alternative to REST, but it’s not a definitive replacement.
+
+GraphQL and REST can actually co-exist in your stack. For example, you can abstract REST APIs behind a [GraphQL server](https://www.howtographql.com/advanced/1-server/). This can be done by masking your REST endpoint into a GraphQL endpoint using [root resolvers](/learn/execution/#root-fields-resolvers).
+
+For an opinionated perspective on how GraphQL compares to REST, check out [How To GraphQL](https://www.howtographql.com/basics/1-graphql-is-the-better-rest/).
+
+### Is GraphQL a database language like SQL?
+
+No, but this is a common misconception.
+
+GraphQL is a specification typically used for remote client-server communications. Unlike SQL, GraphQL is agnostic to the data source(s) used to retrieve data and persist changes. Accessing and manipulating data is performed with arbitrary functions called [resolvers](/learn/execution/). GraphQL coordinates and aggregates the data from these resolver functions, then returns the result to the client. Generally, these resolver functions should delegate to a [business logic layer](/learn/thinking-in-graphs/#business-logic-layer) responsible for communicating with the various underlying data sources. These data sources could be remote APIs, databases, [local cache](/learn/caching/), and nearly anything else your programming language can access.
+
+For more information on how to get GraphQL to interact with your database, check out our [documentation on resolvers](/learn/execution/#root-fields-resolvers).
+
+### How can I learn GraphQL?
+
+There are many resources available to help you learn GraphQL, including this website. In [our documentation](/learn/), you’ll find a series of articles that explain essential GraphQL concepts and how they work. Our [Community page](/community) is full of resources to reference and groups to join.
+
+For more practical guides, visit the [How to GraphQL](https://www.howtographql.com/) fullstack tutorial website. We also have a free online course with edX, [Exploring GraphQL: A Query Language for APIs](https://www.edx.org/course/exploring-graphql-a-query-language-for-apis).
+
+Before you start your learning journey, make sure you know [what an API is](https://www.codenewbie.org/blogs/an-intro-to-apis) and how communication generally works between client and server.
+
+### Is GraphQL only for React or JavaScript developers?
+
+No, not at all. [GraphQL is a specification](https://spec.graphql.org/) that can be [implemented in any language](/learn/schema/#type-language). Our [Code page](/code/) contains a long list of libraries in many different programming languages to help with that.
+
+It’s understandable why you’d think this, though. GraphQL was introduced at a [React conference](https://www.youtube.com/watch?v=9sc8Pyc51uU) and [GraphQL.js](/graphql-js/) is one of the most widely used implementations to date. We know this can be confusing, so we’re working to improve our documentation and add more code samples that aren’t written in JavaScript.
\ No newline at end of file
diff --git a/src/content/faq/Specification.md b/src/content/faq/Specification.md
new file mode 100644
index 0000000000..93d993de58
--- /dev/null
+++ b/src/content/faq/Specification.md
@@ -0,0 +1,24 @@
+---
+title: Specification
+layout: faq
+permalink: /faq/specification
+position: 4
+---
+
+### What is the best way to follow specification releases?
+
+The latest working draft release of the GraphQL specification can be found at [spec.graphql.org/draft](https://spec.graphql.org/draft/). Previous editions are also available at permalinks that match their [release tag](https://github.com/graphql/graphql-spec/releases).
+
+The entire process behind each release is open source. You can monitor specification proposals by following [pull requests in the graphql-spec repository](https://github.com/graphql/graphql-spec/pulls). You can also watch past GraphQL Working Group discussions about various proposals on [YouTube](https://www.youtube.com/channel/UCERcwLeheOXp_u61jEXxHMA).
+
+### How can I contribute to the GraphQL specification?
+
+GraphQL is still evolving and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub.
+
+There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation).
+
+### Where is the documentation for subscriptions?
+
+It's not on this website yet, but we're working on it. If you'd like to help write guides on subscriptions, please [let us know](https://github.com/graphql/graphql.github.io/issues/993).
+
+For now, the specification includes details for [how to write and execute subscriptions](https://spec.graphql.org/draft/#sec-Subscription).
\ No newline at end of file
diff --git a/src/pages/faq.tsx b/src/pages/faq.tsx
new file mode 100644
index 0000000000..9b0b9530c2
--- /dev/null
+++ b/src/pages/faq.tsx
@@ -0,0 +1,70 @@
+import React from "react"
+import Layout from "../components/Layout"
+import FAQSection from "../components/FAQSection"
+import { graphql } from "gatsby"
+import { useFAQAccordion } from "../utils/useFAQAccordion"
+
+export default ({ pageContext, data }: any) => {
+ useFAQAccordion()
+
+ const sections = data.allMarkdownRemark.edges
+ .map((e: any) => e.node)
+ .sort((a: any, b: any) => {
+ const aPosition = a.frontmatter.position
+ const bPosition = b.frontmatter.position
+ if (aPosition < bPosition) {
+ return -1
+ }
+ return 1
+ })
+
+ return (
+
+
+
From f421540ae698636ef7c6353207c3dbe87d3e35cf Mon Sep 17 00:00:00 2001
From: Michael Hayes
Date: Sat, 20 Feb 2021 14:45:38 -0800
Subject: [PATCH 083/439] Add GiraphQL schema builder to list of javascript
libraries
---
.../javascript/tools/giraphql.md | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 src/content/code/language-support/javascript/tools/giraphql.md
diff --git a/src/content/code/language-support/javascript/tools/giraphql.md b/src/content/code/language-support/javascript/tools/giraphql.md
new file mode 100644
index 0000000000..f4f2c62c8b
--- /dev/null
+++ b/src/content/code/language-support/javascript/tools/giraphql.md
@@ -0,0 +1,32 @@
+---
+name: GiraphQL
+description: A plugin based schema builder for creating code-first GraphQL schemas in typescript
+url: https://giraphql.com/
+github: hayes/giraphql
+npm: "@giraphql/core"
+---
+
+GiraphQL makes writing type-safe schemas simple, and works without a code generator,
+build process, or extensive manual type definitions.
+
+```ts
+import { ApolloServer } from "apollo-server"
+import SchemaBuilder from "@giraphql/core"
+
+const builder = new SchemaBuilder({})
+
+builder.queryType({
+ fields: t => ({
+ hello: t.string({
+ args: {
+ name: t.arg.string({}),
+ },
+ resolve: (parent, { name }) => `hello, ${name || "World"}`,
+ }),
+ }),
+})
+
+new ApolloServer({
+ schema: builder.toSchema({}),
+}).listen(3000)
+```
From 3a7b037576a02ba51d9d530c48c65b1eb6ac41db Mon Sep 17 00:00:00 2001
From: Sting Alleman
Date: Sat, 27 Feb 2021 01:20:17 +0100
Subject: [PATCH 084/439] fix links that have renamed branches
---
src/content/faq/General.md | 2 +-
src/content/faq/Specification.md | 2 +-
src/content/learn/Learn-Introspection.md | 4 ++--
src/content/learn/Learn-Validation.md | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/content/faq/General.md b/src/content/faq/General.md
index 496f7424cd..3ac038d0d0 100644
--- a/src/content/faq/General.md
+++ b/src/content/faq/General.md
@@ -45,7 +45,7 @@ Many people! The [GraphQL specification and all related projects](http://github.
The [GraphQL Foundation](#what-is-the-graphql-foundation) provides most of the oversight for GraphQL. It's made up of [representatives from dozens of different companies](https://foundation.graphql.org/members/).
-There are also monthly virtual [GraphQL Working Group (WG)](https://github.com/graphql/graphql-wg) meetings managed by the GraphQL Foundation. These meetings are designed to bring together maintainers of commonly used GraphQL libraries and tools, as well as significant contributors to the GraphQL community. The WG meetings are completely open. Anyone is able to join and [propose items to the agenda](https://github.com/graphql/graphql-wg/blob/master/agendas/).
+There are also monthly virtual [GraphQL Working Group (WG)](https://github.com/graphql/graphql-wg) meetings managed by the GraphQL Foundation. These meetings are designed to bring together maintainers of commonly used GraphQL libraries and tools, as well as significant contributors to the GraphQL community. The WG meetings are completely open. Anyone is able to join and [propose items to the agenda](https://github.com/graphql/graphql-wg/blob/main/agendas/).
In the [November 2020 WG meeting](https://www.youtube.com/watch?v=UybZp9O24Ow), it was announced that GraphQL will have a Technical Steering Committee (TSC) going forward. More on that coming soon.
diff --git a/src/content/faq/Specification.md b/src/content/faq/Specification.md
index 93d993de58..a24db5db11 100644
--- a/src/content/faq/Specification.md
+++ b/src/content/faq/Specification.md
@@ -13,7 +13,7 @@ The entire process behind each release is open source. You can monitor specifica
### How can I contribute to the GraphQL specification?
-GraphQL is still evolving and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub.
+GraphQL is still evolving and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source. [Contributor guidelines](https://github.com/graphql/graphql-spec/blob/main/CONTRIBUTING.md) are available on GitHub.
There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation).
diff --git a/src/content/learn/Learn-Introspection.md b/src/content/learn/Learn-Introspection.md
index 00693e3445..f9c33304b5 100644
--- a/src/content/learn/Learn-Introspection.md
+++ b/src/content/learn/Learn-Introspection.md
@@ -11,7 +11,7 @@ queries it supports. GraphQL allows us to do so using the introspection
system!
For our Star Wars example, the file
-[starWarsIntrospection-test.js](https://github.com/graphql/graphql-js/blob/master/src/__tests__/starWarsIntrospection-test.js)
+[starWarsIntrospection-test.js](https://github.com/graphql/graphql-js/blob/main/src/__tests__/starWarsIntrospection-test.js)
contains a number of queries demonstrating the introspection system, and is a
test file that can be run to exercise the reference implementation's
introspection system.
@@ -180,6 +180,6 @@ and create documentation browsers, or rich IDE experiences.
This has just scratched the surface of the introspection system; we can
query for enum values, what interfaces a type implements, and more. We
can even introspect on the introspection system itself. The specification goes
-into more detail about this topic in the "Introspection" section, and the [introspection](https://github.com/graphql/graphql-js/blob/master/src/type/introspection.js)
+into more detail about this topic in the "Introspection" section, and the [introspection](https://github.com/graphql/graphql-js/blob/main/src/type/introspection.js)
file in GraphQL.js contains code implementing a specification-compliant GraphQL
query introspection system.
diff --git a/src/content/learn/Learn-Validation.md b/src/content/learn/Learn-Validation.md
index e4e2a517ce..5d60a85856 100644
--- a/src/content/learn/Learn-Validation.md
+++ b/src/content/learn/Learn-Validation.md
@@ -12,7 +12,7 @@ developers when an invalid query has been created, without having to rely
on runtime checks.
For our Star Wars example, the file
-[starWarsValidation-test.js](https://github.com/graphql/graphql-js/blob/master/src/__tests__/starWarsValidation-test.js)
+[starWarsValidation-test.js](https://github.com/graphql/graphql-js/blob/main/src/__tests__/starWarsValidation-test.js)
contains a number of queries demonstrating various invalidities, and is a test
file that can be run to exercise the reference implementation's validator.
@@ -165,6 +165,6 @@ This has just scratched the surface of the validation system; there
are a number of validation rules in place to ensure that a GraphQL query
is semantically meaningful. The specification goes into more detail about this
topic in the "Validation" section, and the
-[validation](https://github.com/graphql/graphql-js/blob/master/src/validation)
+[validation](https://github.com/graphql/graphql-js/blob/main/src/validation)
directory in GraphQL.js contains code implementing a
specification-compliant GraphQL validator.
From a1670da48da616047501846ec25956f243ea5743 Mon Sep 17 00:00:00 2001
From: "Terry L. Blessing"
Date: Mon, 1 Mar 2021 13:56:38 -0600
Subject: [PATCH 085/439] Update Introduction.md
Suggested edits to lessen verbosity.
---
src/content/learn/Introduction.md | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/content/learn/Introduction.md b/src/content/learn/Introduction.md
index 426066c466..5d1c0cf8a5 100644
--- a/src/content/learn/Introduction.md
+++ b/src/content/learn/Introduction.md
@@ -7,11 +7,18 @@ permalink: /learn/
next: /learn/queries/
---
-> Learn about GraphQL, how it works, and how to use it in this series of articles. Looking for documentation on how to build a GraphQL service? There are libraries to help you implement GraphQL in [many different languages](/code/). For an in-depth learning experience with practical tutorials, visit the [How to GraphQL](https://www.howtographql.com) fullstack tutorial website. We have also partnered with edX to create a free online course, [Exploring GraphQL: A Query Language for APIs](https://www.edx.org/course/exploring-graphql-a-query-language-for-apis).
+> Learn about GraphQL, how it works, and how to use it. Looking for documentation on how to build a GraphQL service?
+> There are libraries to help you implement GraphQL in [many different languages](/code/). For an in-depth learning experience
+> with practical tutorials, see [How to GraphQL](https://www.howtographql.com). Check out the
+> free online course,
+> [Exploring GraphQL: A Query Language for APIs](https://www.edx.org/course/exploring-graphql-a-query-language-for-apis).
-GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.
+GraphQL is a query language for your API, and a server-side runtime for executing queries using a type system you define for your
+data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.
-A GraphQL service is created by defining types and fields on those types, then providing functions for each field on each type. For example, a GraphQL service that tells us who the logged in user is (`me`) as well as that user's name might look something like this:
+A GraphQL service is created by defining types and fields on those types, then providing functions for each field on each type.
+For example, a GraphQL service that tells you who the logged in user is (`me`) as well as that user's name might look
+like this:
```graphql
type Query {
@@ -36,9 +43,11 @@ function User_name(user) {
}
```
-Once a GraphQL service is running (typically at a URL on a web service), it can receive GraphQL queries to validate and execute. A received query is first checked to ensure it only refers to the types and fields defined, then runs the provided functions to produce a result.
+After a GraphQL service is running (typically at a URL on a web service), it can receive GraphQL queries to validate and execute.
+The service first checks a query to ensure it only refers to the types and fields defined, and then runs the provided functions
+to produce a result.
-For example the query:
+For example, the query:
```graphql
{
@@ -48,7 +57,7 @@ For example the query:
}
```
-Could produce the JSON result:
+Could produce the following JSON result:
```json
{
@@ -58,4 +67,4 @@ Could produce the JSON result:
}
```
-Learn more about GraphQL — the query language, type system, how the GraphQL service works, as well as best practices for using GraphQL in the articles written in this section; they help to solve common problems.
+To learn more, click **Continue Reading**.
From 448e22fea64c2be77e74f1e59715d9ed06ac3d99 Mon Sep 17 00:00:00 2001
From: Yash Kumar Verma
Date: Tue, 2 Mar 2021 10:59:37 +0530
Subject: [PATCH 086/439] remove suspended twitter account
---
src/content/community/Community-Resources.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/content/community/Community-Resources.md b/src/content/community/Community-Resources.md
index d927da9b82..737e97b11b 100644
--- a/src/content/community/Community-Resources.md
+++ b/src/content/community/Community-Resources.md
@@ -22,7 +22,6 @@ Use the [**#graphql** hashtag](https://twitter.com/search?q=%23GraphQL&src=tyah)
Here are some helpful accounts to follow:
- [@GraphQL](https://twitter.com/GraphQL)
- [@graphqlweekly](https://twitter.com/graphqlweekly)
-- [@GraphQLStackOverflow](https://twitter.com/GraphQLatSO)
- [@apollographql](https://twitter.com/apollographql)
- [@prisma](https://twitter.com/prisma)
- [@HasuraHQ](https://twitter.com/HasuraHQ)
From c85b6d3b30926235b3d6aee702c7875f775dcc4a Mon Sep 17 00:00:00 2001
From: Brian Warner
Date: Mon, 8 Mar 2021 10:23:28 -0500
Subject: [PATCH 087/439] Also ignore .swp files
Signed-off-by: Brian Warner
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index e5827081d7..e5507981b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,3 +68,6 @@ yarn-error.log
.pnp.js
# Yarn Integrity file
.yarn-integrity
+
+# Swap files
+*.swp
From 9941bbef254230369ab2b5b1d27e51421b3f302f Mon Sep 17 00:00:00 2001
From: Brian Warner
Date: Tue, 9 Mar 2021 09:38:10 -0500
Subject: [PATCH 088/439] Add FAQ item on specification membership
Signed-off-by: Brian Warner
---
src/content/faq/Specification.md | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/content/faq/Specification.md b/src/content/faq/Specification.md
index 93d993de58..f17e1e9906 100644
--- a/src/content/faq/Specification.md
+++ b/src/content/faq/Specification.md
@@ -17,8 +17,16 @@ GraphQL is still evolving and contributions are very welcome! The specification
There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation).
+### What is GraphQL Specification membership?
+
+The [GraphQL Specification](https://specification.graphql.org) and the associated reference implementations are a Joint Development Foundation project (also part of the Linux Foundation family). Individual or corporate contributors sign a document at no cost that they agree their contributions are under the open source licenses of the project. Because this is not GraphQL Foundation membership, specification members do not decide how to spend the budget.
+
+To sign the [GraphQL Specification membership document](https://github.com/graphql/graphql-wg/tree/HEAD/membership), open a PR against any [GraphQL repo on GitHub](https://github.com/graphql).
+
+If your organization uses and benefits from GraphQL, please consider becoming a member of both by opening a PR on behalf of your company and [joining the GraphQL Foundation](https://join.graphql.org).
+
### Where is the documentation for subscriptions?
It's not on this website yet, but we're working on it. If you'd like to help write guides on subscriptions, please [let us know](https://github.com/graphql/graphql.github.io/issues/993).
-For now, the specification includes details for [how to write and execute subscriptions](https://spec.graphql.org/draft/#sec-Subscription).
\ No newline at end of file
+For now, the specification includes details for [how to write and execute subscriptions](https://spec.graphql.org/draft/#sec-Subscription).
From b2ba7b89f885ac819a146f3bfbfede43be253f5f Mon Sep 17 00:00:00 2001
From: Brian Warner
Date: Tue, 9 Mar 2021 09:38:50 -0500
Subject: [PATCH 089/439] Add FAQ section on the GraphQL Foundation
Signed-off-by: Brian Warner
---
src/content/faq/Foundation.md | 55 +++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100644 src/content/faq/Foundation.md
diff --git a/src/content/faq/Foundation.md b/src/content/faq/Foundation.md
new file mode 100644
index 0000000000..732f6cce5b
--- /dev/null
+++ b/src/content/faq/Foundation.md
@@ -0,0 +1,55 @@
+---
+title: GraphQL Foundation
+layout: faq
+permalink: /faq/graphql-foundation
+position: 6
+---
+
+### What does the GraphQL Foundation do?
+
+The primary responsibility of the Foundation is to set policy and allocate the budget to maximize the sustainability of the GraphQL community. Members participate on a governing board that meets monthly and decides how to allocate its funding.
+
+### Where does the funding go when I become a member?
+
+The GraphQL Foundation is funded exclusively through the support of our members. The governing board sets an annual budget to use the dues to the maximum benefit of the community.
+Ways the Foundation distributes the money raised through memberships include:
+
+* Providing grants and sponsorship to core community developers who are working in neutral roles.
+* Funding core community IT infrastructure
+* Funding coordination, financial, and legal support program for the Foundation and the GraphQL project ecosystem
+* Other community and developer support programs
+
+The GraphQL Foundation budget is realigned as the needs of the community change.
+
+### How are decisions made?
+
+As with other Linux Foundation projects, the governing board makes decisions through votes. Every vote is equal and no members have special voting rights or privileges. The charter currently limits the governing board to 25 members.
+
+### Who can join the GraphQL Foundation?
+
+GraphQL Foundation membership is open to companies who wish to support the GraphQL ecosystem. As the GraphQL Foundation is hosted at the [Linux Foundation](https://linuxfoundation.org), members must also join the Linux Foundation.
+
+### Do I need to join the Foundation to participate in GraphQL development?
+
+No, Foundation membership is separate from the technical development community. There is no cost to participate in GraphQL development, although you must sign the [free GraphQL Specification membership agreement](https://github.com/graphql/graphql-wg/tree/main/membership) in order to participate. These two things are different from each other.
+
+Members join the Foundation in order to provide essential funding and participate in the decisions on how it is used. Developers join the GraphQL Specification in order to contribute ideas, code, and other content. Many companies do both.
+
+### How do I participate in technical development?
+
+We would love to have you! The best place to get started is the [GraphQL Working Group](https://github.com/graphql/graphql-wg/tree/HEAD/membership), which meets monthly. Open a PR to add yourself to the agenda, and you are welcome to join.
+
+Otherwise, you can get involved in [any of our other projects](https://github.com/graphql/graphql-wg/blob/main/GraphQL-TSC.md#about-the-graphql-specification-project).
+
+### Who founded the organization?
+
+The GraphQL Foundation was founded by Apollo, AWS, Butterfly Network, Dgraph Labs, Facebook, Gatsby, GraphZen, Hasura, IBM, Intuit, Neo4j, Novvum, Pipefy, Salsify, Solo.io and Thicit.
+
+### Who is currently a member?
+
+Current GraphQL Foundation members are listed on the [GraphQL Landscape](https://landscape.graphql.org).
+
+### How do we join?
+
+You can become a member of GraphQL Foundation and the Linux Foundation by completing our [membership application form](https://join.graphql.org).
+
From d8e1334d74fc46928a3e3163094e53cbd53fb243 Mon Sep 17 00:00:00 2001
From: Brian Warner
Date: Tue, 9 Mar 2021 10:56:38 -0500
Subject: [PATCH 090/439] Update the URL to the landscape
Signed-off-by: Brian Warner
---
src/pages/users.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pages/users.tsx b/src/pages/users.tsx
index 4c776f512c..7670dddc25 100644
--- a/src/pages/users.tsx
+++ b/src/pages/users.tsx
@@ -30,7 +30,7 @@ export default ({ pageContext }) => {
id="landscape"
scrolling="no"
style={{ width: "1px", minWidth: "100%" }}
- src="https://landscape.graphql.org/category=graph-ql-adopter&format=card-mode&grouping=category&embed=yes"
+ src="https://landscape.graphql.org/card-mode?category=graph-ql-adopter&grouping=category&embed=yes"
onLoad={() => {
const scriptElem = document.createElement('script');
scriptElem.type = 'text/javascript';
From 006a9e1bd875bc17057bd2088b2f470bd3c71353 Mon Sep 17 00:00:00 2001
From: Brian Warner
Date: Tue, 9 Mar 2021 11:50:15 -0500
Subject: [PATCH 091/439] Update users page to use new URL and borderless cards
Signed-off-by: Brian Warner
---
src/assets/css/_css/users.less | 17 +++++++++--------
src/pages/users.tsx | 2 +-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/assets/css/_css/users.less b/src/assets/css/_css/users.less
index b92fbab106..b6e5bebee6 100644
--- a/src/assets/css/_css/users.less
+++ b/src/assets/css/_css/users.less
@@ -1,14 +1,7 @@
-section.whos-using-page {
+section.whos-using-page, section.foundation-members-page {
padding-bottom: 6em;
- text-align: center;
max-width: 900px;
- .prose {
- max-width: 560px;
- text-align: center;
- margin: 0 auto;
- }
-
.logos {
align-items: center;
display: flex;
@@ -38,3 +31,11 @@ section.whos-using-page {
}
}
}
+
+section.whos-using-page {
+ .prose {
+ max-width: 560px;
+ text-align: center;
+ margin: 0 auto;
+ }
+}
diff --git a/src/pages/users.tsx b/src/pages/users.tsx
index 7670dddc25..c65ee1aa3d 100644
--- a/src/pages/users.tsx
+++ b/src/pages/users.tsx
@@ -30,7 +30,7 @@ export default ({ pageContext }) => {
id="landscape"
scrolling="no"
style={{ width: "1px", minWidth: "100%" }}
- src="https://landscape.graphql.org/card-mode?category=graph-ql-adopter&grouping=category&embed=yes"
+ src="https://landscape.graphql.org/card-mode?category=graph-ql-adopter&grouping=category&embed=yes&style=borderless"
onLoad={() => {
const scriptElem = document.createElement('script');
scriptElem.type = 'text/javascript';
From 7cc92465420ec95f26cc00c2a5ff1778c548525d Mon Sep 17 00:00:00 2001
From: Brian Warner
Date: Tue, 9 Mar 2021 11:50:31 -0500
Subject: [PATCH 092/439] Add Foundation members landscape cards
Signed-off-by: Brian Warner
---
src/pages/foundation/members.tsx | 41 ++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 src/pages/foundation/members.tsx
diff --git a/src/pages/foundation/members.tsx b/src/pages/foundation/members.tsx
new file mode 100644
index 0000000000..cc315d9e47
--- /dev/null
+++ b/src/pages/foundation/members.tsx
@@ -0,0 +1,41 @@
+import React from "react"
+import Layout from "../../components/Layout"
+
+export default ({ pageContext }) => {
+ return (
+
+
+
+
GraphQL Foundation members
+
+ The GraphQL Foundation is the primary way in which funding is
+ raised and distributed to support essential GraphQL community programs. The members
+ listed on this page are directly invested in the success and long-term sustainability of
+ the GraphQL community.
+