Skip to content

Commit 0547249

Browse files
committed
restructure
1 parent 797eb01 commit 0547249

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+26252
-33258
lines changed

.babelrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[
55
"@babel/preset-env",
66
{ "bugfixes": true, "targets": { "node": "current" } }
7-
]
7+
],
8+
"@docusaurus/core/lib/babel/preset"
89
]
910
}

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@
1414
/denoDist
1515
/npm
1616
/deno
17+
/build
18+
.docusaurus
19+
.cache-loader
20+
.DS_Store
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

.prettierignore

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
/denoDist
88
/npm
99
/deno
10-
11-
# Docs Site
12-
/www/.docusaurus
13-
/www/build
10+
/build
11+
.docusaurus
12+
.cache-loader
13+
.DS_Store
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

www/src/pages/index.js renamed to docs/src/pages/index.js

-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Layout from '@theme/Layout';
44
import Link from '@docusaurus/Link';
55
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
66
import styles from './index.module.css';
7-
import HomepageFeatures from '../components/HomepageFeatures';
87

98
function HomepageHeader() {
109
const { siteConfig } = useDocusaurusContext();
@@ -30,9 +29,6 @@ export default function Home() {
3029
description="A reference implementation of GraphQL for JavaScript"
3130
>
3231
<HomepageHeader />
33-
<main>
34-
<HomepageFeatures />
35-
</main>
3632
</Layout>
3733
);
3834
}
File renamed without changes.

www/tutorials/authentication-and-express-middleware.md renamed to docs/tutorials/authentication-and-express-middleware.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Authentication and Express Middleware
33
sidebar_label: Authentication & Middleware
4-
sidebar_position: 7
54
---
65

76
It's simple to use any Express middleware in conjunction with `express-graphql`. In particular, this is a great pattern for handling authentication.

www/tutorials/basic-types.md renamed to docs/tutorials/basic-types.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Basic Types
3-
sidebar_position: 3
43
---
54

65
In most situations, all you need to do is to specify the types for your API using the GraphQL schema language, taken as an argument to the `buildSchema` function.

www/tutorials/constructing-types.md renamed to docs/tutorials/constructing-types.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Constructing Types
33
category: Advanced Guides
4-
sidebar_position: 8
54
---
65

76
For many apps, you can define a fixed schema when the application starts, and define it using GraphQL schema language. In some cases, it's useful to construct a schema programmatically. You can do this using the `GraphQLSchema` constructor.

www/tutorials/express-graphql.md renamed to docs/tutorials/express-graphql.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: express-graphql
3-
sidebar_position: 9
43
---
54

65
The `express-graphql` module provides a simple way to create an [Express](https://expressjs.com/) server that runs a GraphQL API.

www/tutorials/graphql-clients.md renamed to docs/tutorials/graphql-clients.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: GraphQL Clients
33
category: GraphQL.js Tutorial
4-
sidebar_position: 2
54
---
65

76
Since a GraphQL API has more underlying structure than a REST API, there are more powerful clients like [Relay](https://facebook.github.io/relay/) which can automatically handle batching, caching, and other features. But you don't need a complex client to call a GraphQL server. With `express-graphql`, you can just send an HTTP POST request to the endpoint you mounted your GraphQL server on, passing the GraphQL query as the `query` field in a JSON payload.

www/tutorials/index.md renamed to docs/tutorials/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Getting Started With GraphQL.js
3-
sidebar_position: 0
43
slug: /
54
---
65

www/tutorials/mutations-and-input-types.md renamed to docs/tutorials/mutations-and-input-types.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Mutations and Input Types
3-
sidebar_position: 6
43
---
54

65
If you have an API endpoint that alters data, like inserting data into a database or altering data already in a database, you should make this endpoint a `Mutation` rather than a `Query`. This is as simple as making the API endpoint part of the top-level `Mutation` type instead of the top-level `Query` type.

www/tutorials/object-types.md renamed to docs/tutorials/object-types.md

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
title: Object Types
3-
sidebar_position: 5
43
category: GraphQL.js Tutorial
5-
permalink: /graphql-js/object-types/
6-
next: /graphql-js/mutations-and-input-types/
74
---
85

96
In many cases, you don't want to return a number or a string from an API. You want to return an object that has its own complex behavior. GraphQL is a perfect fit for this.

www/tutorials/passing-arguments.md renamed to docs/tutorials/passing-arguments.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Passing Arguments
3-
sidebar_position: 4
43
---
54

65
Just like a REST API, it's common to pass arguments to an endpoint in a GraphQL API. By defining the arguments in the schema language, type checking happens automatically. Each argument must be named and have a type. For example, in the [Basic Types documentation](./basic-types.md) we had an endpoint called `rollThreeDice`:

www/tutorials/running-an-express-graphql-server.md renamed to docs/tutorials/running-an-express-graphql-server.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Running an Express GraphQL Server
33
sidebar_label: Running Express + GraphQL
4-
sidebar_position: 1
54
---
65

76
The simplest way to run a GraphQL API server is to use [Express](https://expressjs.com), a popular web application framework for Node.js. You will need to install two additional dependencies:

www/docusaurus.config.js renamed to docusaurus.config.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
'use strict';
12
const path = require('path');
3+
24
const lightCodeTheme = require('prism-react-renderer/themes/github');
35
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
46

@@ -11,8 +13,8 @@ module.exports = {
1113
onBrokenLinks: 'warn', // temporary need to find a way for typedoc generated docs to work
1214
onBrokenMarkdownLinks: 'warn',
1315
favicon: 'img/favicon.ico',
14-
organizationName: 'graphql', // Usually your GitHub org/user name.
15-
projectName: 'graphql-js', // Usually your repo name.
16+
organizationName: 'graphql',
17+
projectName: 'graphql-js',
1618
themeConfig: {
1719
navbar: {
1820
title: 'graphql-js',
@@ -34,7 +36,6 @@ module.exports = {
3436
},
3537
{
3638
to: 'api/graphql-js',
37-
to: 'api',
3839
label: 'API',
3940
position: 'left',
4041
},
@@ -106,18 +107,17 @@ module.exports = {
106107
[
107108
'@docusaurus/preset-classic',
108109
{
110+
pages: {
111+
path: './docs/src/pages',
112+
},
109113
docs: {
110-
path: 'tutorials',
114+
path: './docs/tutorials',
111115
routeBasePath: 'tutorials',
112116
sidebarPath: require.resolve('./sidebars.js'),
113-
editUrl: 'https://github.com/graphql/graphql-js/edit/main/www/',
114-
},
115-
blog: {
116-
showReadingTime: true,
117-
editUrl: 'https://github.com/graphql/graphql-js/edit/main/www/blog/',
117+
editUrl: 'https://github.com/graphql/graphql-js/edit/main/docs/',
118118
},
119119
theme: {
120-
customCss: require.resolve('./src/css/custom.css'),
120+
customCss: require.resolve('./docs/src/css/custom.css'),
121121
},
122122
},
123123
],
@@ -126,7 +126,7 @@ module.exports = {
126126
[
127127
'docusaurus-plugin-typedoc-api',
128128
{
129-
projectRoot: path.join(__dirname, '..'),
129+
projectRoot: path.join(__dirname, '.'),
130130
packages: [{ path: '.', slug: 'graphql-js' }],
131131
},
132132
],

0 commit comments

Comments
 (0)