Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions website/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/pages/_document.tsx
/pages/_app.tsx
31 changes: 0 additions & 31 deletions website/docs/tutorials/defer-stream.md

This file was deleted.

11 changes: 6 additions & 5 deletions website/next.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* eslint-disable camelcase */
import path from 'node:path';
import fs from 'node:fs';
import path from 'node:path';

import nextra from 'nextra';

const fileContents = fs.readFileSync('./vercel.json', 'utf-8');
const vercel = JSON.parse(fileContents);

import nextra from 'nextra';

const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
Expand All @@ -33,7 +32,7 @@ export default withNextra({
});
return config;
},
redirects: async () => vercel.redirects,
redirects: () => vercel.redirects,
output: 'export',
images: {
loader: 'custom',
Expand All @@ -42,6 +41,7 @@ export default withNextra({
},
transpilePackages: ['next-image-export-optimizer'],
env: {
/* eslint-disable camelcase */
nextImageExportOptimizer_imageFolderPath: 'public/images',
nextImageExportOptimizer_exportFolderPath: 'out',
nextImageExportOptimizer_quality: '75',
Expand All @@ -54,6 +54,7 @@ export default withNextra({
// If you want to cache the remote images, you can set the time to live of the cache in seconds.
// The default value is 0 seconds.
nextImageExportOptimizer_remoteImageCacheTTL: '0',
/* eslint-enable camelcase */
},
trailingSlash: true,
});
3 changes: 3 additions & 0 deletions website/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* eslint-disable camelcase, new-cap, react/react-in-jsx-scope, react/no-unknown-property */

import type { AppProps } from 'next/app';
import { Roboto_Flex, Roboto_Mono } from 'next/font/google';

// eslint-disable-next-line import/no-unassigned-import
import '../css/globals.css';

const robotoFlex = Roboto_Flex({
Expand Down
4 changes: 3 additions & 1 deletion website/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Html, Head, Main, NextScript } from 'next/document';
/* eslint-disable react/react-in-jsx-scope */

import { Head, Html, Main, NextScript } from 'next/document';

export default function Document() {
return (
Expand Down
19 changes: 1 addition & 18 deletions website/pages/api-v16/language.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const editedAST = visit(ast, {

Alternatively to providing enter() and leave() functions, a visitor can
instead provide functions named the same as the kinds of AST nodes, or
enter/leave visitors at a named key, leading to four permutations of
enter/leave visitors at a named key, leading to three permutations of
visitor API:

1. Named visitors triggered when entering a node a specific kind.
Expand Down Expand Up @@ -261,23 +261,6 @@ visit(ast, {
});
```

4. Parallel visitors for entering and leaving nodes of a specific kind.

```js
visit(ast, {
enter: {
Kind(node) {
// enter the "Kind" node
},
},
leave: {
Kind(node) {
// leave the "Kind" node
},
},
});
```

### `BREAK`

The sentinel `BREAK` value described in the documentation of `visitor`.
Expand Down
9 changes: 9 additions & 0 deletions website/pages/docs/_meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ const meta = {
'using-directives': '',
'authorization-strategies': '',
'-- 4': {
type: 'separator',
title: 'Testing',
},
'testing-graphql-servers': '',
'testing-approaches': '',
'testing-operations': '',
'testing-resolvers': '',
'testing-best-practices': '',
'-- 5': {
type: 'separator',
title: 'Production & Scaling',
},
Expand Down
2 changes: 1 addition & 1 deletion website/pages/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ graphql({
schema,
source: '{ hello }',
}).then((response) => {
console.log(JSON.stringify(response, null, 2));
console.log(response);
});
```
</Tabs.Tab>
Expand Down
40 changes: 20 additions & 20 deletions website/pages/docs/mutations-and-input-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,6 @@ type Query {
getMessages: [Message]
}

const root = {
getMessage: ({ id }) => {
return fakeDatabase[id]
},
getMessages: () => {
return Object.values(fakeDatabase)
},
createMessage: ({ input }) => {
const id = String(Object.keys(fakeDatabase).length + 1)
const message = new Message(id, input)
fakeDatabase[id] = message
return message
},
updateMessage: ({ id, input }) => {
const message = fakeDatabase[id]
Object.assign(message, input)
return message
}
}

type Mutation {
createMessage(input: MessageInput): Message
updateMessage(id: ID!, input: MessageInput): Message
Expand All @@ -265,6 +245,26 @@ class Message {
}
}

const root = {
getMessage: ({ id }) => {
return fakeDatabase[id]
},
getMessages: () => {
return Object.values(fakeDatabase)
},
createMessage: ({ input }) => {
const id = String(Object.keys(fakeDatabase).length + 1)
const message = new Message(id, input)
fakeDatabase[id] = message
return message
},
updateMessage: ({ id, input }) => {
const message = fakeDatabase[id]
Object.assign(message, input)
return message
}
}

const app = express();
app.all(
'/graphql',
Expand Down
2 changes: 1 addition & 1 deletion website/pages/docs/running-an-express-graphql-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The simplest way to run a GraphQL API server is to use [Express](https://express
npm install express graphql-http graphql --save
```

Let's modify our hello world example so that it's an API server rather than a script that runs a single query. We can use the 'express' module to run a web server, and instead of executing a query directly with the `graphql` function, we can use the `graphql-http` library to mount a GraphQL API server on the /graphql HTTP endpoint:
Let's modify our "hello world" example so that it's an API server rather than a script that runs a single query. We can use the 'express' module to run a webserver, and instead of executing a query directly with the `graphql` function, we can use the `graphql-http` library to mount a GraphQL API server on the "/graphql" HTTP endpoint:

<Tabs items={['SDL', 'Code']}>
<Tabs.Tab>
Expand Down
7 changes: 3 additions & 4 deletions website/pages/docs/scaling-graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ GraphQL.js, you'll need to:
- Output a schema that conforms to a federation-compliant format

Most federation tooling today is based on
[Apollo Federation](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/federation).
[Apollo Federation](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/federation) and [here you can find a list of Apollo Federation compatible gateways](https://the-guild.dev/graphql/hive/federation-gateway-audit).

However, other approaches exist:

- [GraphQL Mesh](https://the-guild.dev/graphql/mesh) allows federation-like composition across
services using plugins.
- Custom gateways and tooling can be implemented using GraphQL.js or other frameworks.
- The [GraphQL Composite Schemas WG](https://github.com/graphql/composite-schemas-wg/) (formed of Apollo, ChilliCream, The Guild, Netflix, Graphile and many more) are working on an open specification for the next generation of GraphQL Federation

Expand Down Expand Up @@ -158,4 +157,4 @@ Make sure your team has the operational maturity to support the tooling and patt
- Define ownership boundaries. Federation is most useful when teams need clear control over parts of
the schema. Without strong ownership models, a federated graph can become harder to manage.
- Consider alternatives. Not all use cases need stitching or federation. Sometimes, versioning, modular
schema design, or schema delegation patterns within a monolith are sufficient.
schema design, or schema delegation patterns within a monolith are sufficient.
Loading
Loading