Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj committed Nov 13, 2021
1 parent 797eb01 commit 0547249
Show file tree
Hide file tree
Showing 44 changed files with 26,252 additions and 33,258 deletions.
3 changes: 2 additions & 1 deletion .babelrc.json
Expand Up @@ -4,6 +4,7 @@
[
"@babel/preset-env",
{ "bugfixes": true, "targets": { "node": "current" } }
]
],
"@docusaurus/core/lib/babel/preset"
]
}
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -14,3 +14,10 @@
/denoDist
/npm
/deno
/build
.docusaurus
.cache-loader
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
11 changes: 7 additions & 4 deletions .prettierignore
Expand Up @@ -7,7 +7,10 @@
/denoDist
/npm
/deno

# Docs Site
/www/.docusaurus
/www/build
/build
.docusaurus
.cache-loader
.DS_Store
npm-debug.log*
yarn-debug.log*
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.
4 changes: 0 additions & 4 deletions www/src/pages/index.js → docs/src/pages/index.js
Expand Up @@ -4,7 +4,6 @@ import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
import HomepageFeatures from '../components/HomepageFeatures';

function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
Expand All @@ -30,9 +29,6 @@ export default function Home() {
description="A reference implementation of GraphQL for JavaScript"
>
<HomepageHeader />
<main>
<HomepageFeatures />
</main>
</Layout>
);
}
File renamed without changes.
@@ -1,7 +1,6 @@
---
title: Authentication and Express Middleware
sidebar_label: Authentication & Middleware
sidebar_position: 7
---

It's simple to use any Express middleware in conjunction with `express-graphql`. In particular, this is a great pattern for handling authentication.
Expand Down
@@ -1,6 +1,5 @@
---
title: Basic Types
sidebar_position: 3
---

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.
Expand Down
@@ -1,7 +1,6 @@
---
title: Constructing Types
category: Advanced Guides
sidebar_position: 8
---

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.
Expand Down
@@ -1,6 +1,5 @@
---
title: express-graphql
sidebar_position: 9
---

The `express-graphql` module provides a simple way to create an [Express](https://expressjs.com/) server that runs a GraphQL API.
Expand Down
@@ -1,7 +1,6 @@
---
title: GraphQL Clients
category: GraphQL.js Tutorial
sidebar_position: 2
---

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.
Expand Down
1 change: 0 additions & 1 deletion www/tutorials/index.md → docs/tutorials/index.md
@@ -1,6 +1,5 @@
---
title: Getting Started With GraphQL.js
sidebar_position: 0
slug: /
---

Expand Down
@@ -1,6 +1,5 @@
---
title: Mutations and Input Types
sidebar_position: 6
---

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.
Expand Down
@@ -1,9 +1,6 @@
---
title: Object Types
sidebar_position: 5
category: GraphQL.js Tutorial
permalink: /graphql-js/object-types/
next: /graphql-js/mutations-and-input-types/
---

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.
Expand Down
@@ -1,6 +1,5 @@
---
title: Passing Arguments
sidebar_position: 4
---

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`:
Expand Down
@@ -1,7 +1,6 @@
---
title: Running an Express GraphQL Server
sidebar_label: Running Express + GraphQL
sidebar_position: 1
---

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:
Expand Down
22 changes: 11 additions & 11 deletions www/docusaurus.config.js → docusaurus.config.js
@@ -1,4 +1,6 @@
'use strict';
const path = require('path');

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

Expand All @@ -11,8 +13,8 @@ module.exports = {
onBrokenLinks: 'warn', // temporary need to find a way for typedoc generated docs to work
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'graphql', // Usually your GitHub org/user name.
projectName: 'graphql-js', // Usually your repo name.
organizationName: 'graphql',
projectName: 'graphql-js',
themeConfig: {
navbar: {
title: 'graphql-js',
Expand All @@ -34,7 +36,6 @@ module.exports = {
},
{
to: 'api/graphql-js',
to: 'api',
label: 'API',
position: 'left',
},
Expand Down Expand Up @@ -106,18 +107,17 @@ module.exports = {
[
'@docusaurus/preset-classic',
{
pages: {
path: './docs/src/pages',
},
docs: {
path: 'tutorials',
path: './docs/tutorials',
routeBasePath: 'tutorials',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/graphql/graphql-js/edit/main/www/',
},
blog: {
showReadingTime: true,
editUrl: 'https://github.com/graphql/graphql-js/edit/main/www/blog/',
editUrl: 'https://github.com/graphql/graphql-js/edit/main/docs/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
customCss: require.resolve('./docs/src/css/custom.css'),
},
},
],
Expand All @@ -126,7 +126,7 @@ module.exports = {
[
'docusaurus-plugin-typedoc-api',
{
projectRoot: path.join(__dirname, '..'),
projectRoot: path.join(__dirname, '.'),
packages: [{ path: '.', slug: 'graphql-js' }],
},
],
Expand Down

0 comments on commit 0547249

Please sign in to comment.