Skip to content

Commit

Permalink
Merge pull request #7938 from apollographql/main-docs-replatform-conn…
Browse files Browse the repository at this point in the history
…ectors

docs: update for new docs platform
  • Loading branch information
Meschreiber authored Oct 16, 2024
2 parents ae16ccd + 438e186 commit 4afa612
Show file tree
Hide file tree
Showing 38 changed files with 344 additions and 78 deletions.
2 changes: 2 additions & 0 deletions cspell-dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Changesets
cimg
circleci
cleartext
CNCF
codecov
codegen
codepaths
Expand Down Expand Up @@ -181,6 +182,7 @@ sumby
supergraph
Supergraph
supergraphs
technotes
testful
testonly
testsuite
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/plugin/cache-control.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "API Reference: Cache control plugin"
title: "API Reference: Cache Control Plugin"
api_reference: true
---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/plugin/drain-http-server.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'API Reference: Drain HTTP server plugin'
title: 'API Reference: Drain HTTP Server Plugin'
api_reference: true
---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/plugin/inline-trace.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "API Reference: Inline trace plugin"
title: "API Reference: Inline Trace Plugin"
api_reference: true
---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/plugin/landing-pages.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "API Reference: Landing page plugins"
title: "API Reference: Landing Page Plugins"
api_reference: true
---

Expand Down
6 changes: 3 additions & 3 deletions docs/source/api/plugin/schema-reporting.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
title: "API Reference: Schema reporting plugin"
title: "API Reference: Schema Reporting Plugin"
api_reference: true
---

> Note:
> **The schema reporting plugin does not support graphs that use Apollo Federation.** If you are using Federation, or if you want to publish your monolith schema in your CI/CD pipeline, you can use the [Rover CLI to publish your schema or subgraph changes](/graphos/schema/cli-registration).
> **The schema reporting plugin does not support graphs that use Apollo Federation.** If you are using Federation, or if you want to publish your monolith schema in your CI/CD pipeline, you can use the [Rover CLI to publish your schema or subgraph changes](/graphos/delivery/publishing-schemas).
## Using the plugin

This article documents the options for the `ApolloServerPluginSchemaReporting` plugin, which you can import from `@apollo/server/plugin/schemaReporting`.

This plugin enables your GraphQL server to register its latest schema with the Apollo schema registry every time it starts up. Full details on schema reporting can be found in [the Apollo Studio docs](/studio/schema/schema-reporting/).
This plugin enables your GraphQL server to register its latest schema with the Apollo schema registry every time it starts up. Full details on schema reporting can be found in [the Apollo Studio docs](/graphos/delivery/publishing-schemas).

In order to use this plugin, you must configure your server with a graph API key, either with the `APOLLO_KEY` environment variable or by passing it directly to your `ApolloServer` constructor (e.g., `new ApolloServer({apollo: {key: KEY}})`). This is the same way you configure [usage reporting](./usage-reporting).

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/plugin/subscription-callback.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "API Reference: Subscription callback plugin"
title: "API Reference: Subscription Callback Plugin"
api_reference: true
minVersion: 4.9.0
---
Expand Down
8 changes: 4 additions & 4 deletions docs/source/api/plugin/usage-reporting.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "API Reference: Usage reporting plugin"
title: "API Reference: Usage Reporting Plugin"
api_reference: true
---

> Sending metrics from Apollo Server to GraphOS requires an [enterprise plan](../org/plans/).
> If your organization _doesn't_ currently have an Enterprise plan, you can test out this functionality by signing up for a free [Enterprise trial](https://studio.apollographql.com/signup?type=enterprise-trial&referrer=docs-content).
> Sending metrics from Apollo Server to GraphOS requires an [Enterprise plan](https://www.apollographql.com/pricing).
> If your organization doesn't have an Enterprise plan, you can test out this functionality by signing up for a free [GraphOS trial](https://studio.apollographql.com/signup?referrer=docs-content).
Apollo Server's built-in usage reporting plugin gathers data on how your clients use the operations and fields in your GraphQL schema. The plugin also handles pushing this usage data to [GraphOS](/graphos/), as described in [Metrics and logging](../../monitoring/metrics/).

Expand Down Expand Up @@ -147,7 +147,7 @@ Providing a number `x` is equivalent to passing this function:
* The operation _doesn't_ produce a trace that can be viewed in the Traces section of the Operations page in Studio.
* The operation _does_ still contribute to most features of Studio, such as schema checks, the Operations page, and the "referencing operations" statistic on the Fields page.

(For more information about the difference between the "referencing operations" and "field executions" statistics, see [the Studio Fields page documentation](https://apollographql.com/docs/studio/metrics/field-usage/).)
(For more information about the difference between the "referencing operations" and "field executions" statistics, see [the Studio Fields page documentation](/graphos/metrics/field-usage).)

Returning `false` (or `0`) for some or all operations can improve your server's performance, because calculating complete traces can introduce significant overhead. This is especially true for a federated graph, because traces are transmitted from the subgraph to the Gateway in-band inside the actual GraphQL response.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/builtin-plugins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Built-in plugins
title: Built-In Plugins
---

**Plugins** extend Apollo Server's functionality by performing custom operations in response to certain events. These events correspond to individual phases of the GraphQL request lifecycle, and to the lifecycle of Apollo Server itself.
Expand Down
67 changes: 34 additions & 33 deletions docs/source/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
],
"sidebar": {
"Introduction": "/",
"Get started": "/getting-started",
"Get Started": "/getting-started",
"New in v4": {
"Migrating to Apollo Server 4": "/migration",
"Previous versions": "/previous-versions",
"Previous Versions": "/previous-versions",
"Changelog": "https://github.com/apollographql/apollo-server/blob/main/packages/server/CHANGELOG.md"
},
"Defining a Schema": {
"Schema basics": "/schema/schema",
"Unions and interfaces": "/schema/unions-interfaces",
"Custom scalars": "/schema/custom-scalars",
"Schema Basics": "/schema/schema",
"Unions and Interfaces": "/schema/unions-interfaces",
"Custom Scalars": "/schema/custom-scalars",
"Directives": "/schema/directives"
},
"Resolving Operations": {
"Resolvers": "/data/resolvers",
"Sharing context": "/data/context",
"Error handling": "/data/errors",
"Sharing Context": "/data/context",
"Error Handling": "/data/errors",
"Subscriptions": "/data/subscriptions"
},
"Fetching Data": {
Expand All @@ -31,35 +31,35 @@
},
"Web Frameworks": {
"Integrations": "/integrations/integration-index",
"Building integrations": "/integrations/building-integrations",
"MERN stack tutorial": "/integrations/mern"
"Building Integrations": "/integrations/building-integrations",
"MERN Stack Tutorial": "/integrations/mern"
},
"Development Workflow": {
"Build and run queries": "/workflow/build-run-queries",
"Request format": "/workflow/requests",
"Generating TS types": "/workflow/generate-types",
"Build and Run Queries": "/workflow/build-run-queries",
"Request Format": "/workflow/requests",
"Generating TS Types": "/workflow/generate-types",
"Mocking": "/testing/mocking",
"Integration testing": "/testing/testing",
"Apollo Studio Explorer": "https://www.apollographql.com/docs/studio/explorer/"
"Integration Testing": "/testing/testing"
},
"Performance": {
"Caching": "/performance/caching",
"Cache backends": "/performance/cache-backends",
"Automatic persisted queries": "/performance/apq"
"Cache Backends": "/performance/cache-backends",
"Response Cache Eviction": "/performance/response-cache-eviction",
"Automatic Persisted Queries": "/performance/apq"
},
"Security": {
"Auth": "/security/authentication",
"Authentication and Authorization": "/security/authentication",
"CORS": "/security/cors",
"Terminating SSL": "/security/terminating-ssl",
"Proxy configuration": "/security/proxy-configuration"
"Proxy Configuration": "/security/proxy-configuration"
},
"Deployment": {
"Lambda": "/deployment/lambda",
"Heroku": "/deployment/heroku"
},
"Monitoring": {
"Metrics and logging": "/monitoring/metrics",
"Health checks": "/monitoring/health-checks"
"Metrics and Logging": "/monitoring/metrics",
"Health Checks": "/monitoring/health-checks"
},
"API Reference": {
"ApolloServer": "/api/apollo-server",
Expand All @@ -68,28 +68,29 @@
},
"Plugins": {
"Overview": "/builtin-plugins",
"Built-in": {
"Usage reporting": "/api/plugin/usage-reporting",
"Schema reporting": "/api/plugin/schema-reporting",
"Inline trace": "/api/plugin/inline-trace",
"Drain HTTP server": "/api/plugin/drain-http-server",
"Cache control": "/api/plugin/cache-control",
"Landing pages": "/api/plugin/landing-pages",
"Federated subscriptions": "/api/plugin/subscription-callback"
"Built-In": {
"Usage Reporting": "/api/plugin/usage-reporting",
"Schema Reporting": "/api/plugin/schema-reporting",
"Inline Trace": "/api/plugin/inline-trace",
"Drain HTTP Server": "/api/plugin/drain-http-server",
"Cache Control": "/api/plugin/cache-control",
"Landing Pages": "/api/plugin/landing-pages",
"Federated Subscriptions": "/api/plugin/subscription-callback"
},
"Custom": {
"Creating plugins": "/integrations/plugins",
"Event reference": "/integrations/plugins-event-reference"
"Creating Plugins": "/integrations/plugins",
"Event Reference": "/integrations/plugins-event-reference"
}
},
"Using with Federation": {
"As a subgraph": {
"As a Subgraph": {
"Setup": "/using-federation/apollo-subgraph-setup",
"@apollo/subgraph reference": "/using-federation/api/apollo-subgraph/"
},
"As a gateway": {
"As a Gateway": {
"Setup": "/using-federation/apollo-gateway-setup",
"@apollo/gateway reference": "/using-federation/api/apollo-gateway/"
"Performance Optimizations": "/using-federation/gateway-performance",
"@apollo/gateway Reference": "/using-federation/api/apollo-gateway/"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data/errors.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Error handling
title: Error Handling
description: Making errors actionable on the client and server
---

Expand Down
8 changes: 7 additions & 1 deletion docs/source/data/fetching-data.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Fetching data
title: Fetching Data
description: Manage connections to databases and other data sources
---

Expand All @@ -26,6 +26,12 @@ flowchart LR;
client --Sends query--> ApolloServer;
```

<Tip>

[Learn how Apollo Connectors](/graphos/schema-design/connectors/) simplify incorporating REST APIs into your graph.

</Tip>

Because your server can use multiple various data sources, keeping your [resolvers](./resolvers) tidy becomes _even more_ important.

For this reason, we recommend creating individual data source classes to encapsulate the logic of fetching data from a particular source, providing methods that resolvers can use to access data neatly. You can additionally customize your data source classes to help with caching, deduplication, or errors while resolving operations.
Expand Down
6 changes: 6 additions & 0 deletions docs/source/data/fetching-rest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ description: Using RESTDataSource to fetch data from REST APIs

import TopLevelAwait from "../shared/top-level-await.mdx"

<Tip>

[Learn how Apollo Connectors](/graphos/schema-design/connectors/) simplify incorporating REST APIs into your graph.

</Tip>

> See the [`@apollo/datasource-rest` README](https://github.com/apollographql/datasource-rest) for the full details of the `RESTDataSource` API.
The `RESTDataSource` class simplifies fetching data from REST APIs and helps handle caching, request deduplication, and errors while resolving operations.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data/resolvers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -483,4 +483,4 @@ See [Resolving Entities](https://www.apollographql.com/docs/federation/entities/

As with all code, a resolver's performance depends on its logic. It's important to understand which of your schema's fields are computationally expensive or otherwise slow to resolve, so that you can either improve their performance or make sure you only query them when necessary.

[Apollo Studio](https://www.apollographql.com/docs/studio/) integrates directly with Apollo Server to provide field-level metrics that help you understand the performance of your graph over time. For more information, see [Analyzing performance](https://www.apollographql.com/docs/studio/performance/).
[Apollo Studio](https://studio.apollographql.com) integrates directly with Apollo Server to provide field-level metrics that help you understand the performance of your graph over time. For more information, see [Analyzing performance](https://www.apollographql.com/docs/graphos/platform/insights/field-usage).
2 changes: 1 addition & 1 deletion docs/source/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Get started with Apollo Server
title: Get Started with Apollo Server
description: ''
---

Expand Down
8 changes: 4 additions & 4 deletions docs/source/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Introduction to Apollo Server

> 📣 **Apollo Server 4 is generally available!**
>
> [See what's new](./migration/)!
> [See what's new](/apollo-server/migration/)!
>
> Docs for Apollo Server 3 are [available here](/apollo-server/v3/).
Expand All @@ -14,8 +14,8 @@ title: Introduction to Apollo Server

#### You can use Apollo Server as:

* The GraphQL server for a [subgraph](./using-federation/apollo-subgraph-setup) in a federated supergraph
* An add-on to any new or existing Node.js apps—this includes apps running on [Express](./api/express-middleware) (including [MERN stack](./integrations/mern) apps), [AWS Lambda](https://www.npmjs.com/package/@as-integrations/aws-lambda), [Azure Functions](https://www.npmjs.com/package/@as-integrations/azure-functions), [Cloudflare](https://www.npmjs.com/package/@as-integrations/cloudflare-workers), [Fastify](https://www.npmjs.com/package/@as-integrations/fastify), and [more](./integrations/integration-index)
* The GraphQL server for a [subgraph](/apollo-server/using-federation/apollo-subgraph-setup) in a federated supergraph
* An add-on to any new or existing Node.js apps—this includes apps running on [Express](/apollo-server/api/express-middleware) (including [MERN stack](/apollo-server/integrations/mern) apps), [AWS Lambda](https://www.npmjs.com/package/@as-integrations/aws-lambda), [Azure Functions](https://www.npmjs.com/package/@as-integrations/azure-functions), [Cloudflare](https://www.npmjs.com/package/@as-integrations/cloudflare-workers), [Fastify](https://www.npmjs.com/package/@as-integrations/fastify), and [more](/apollo-server/integrations/integration-index)

#### Apollo Server provides:

Expand All @@ -27,7 +27,7 @@ title: Introduction to Apollo Server
#### Ready to try it out?

<div align="center">
<ButtonLink href="./getting-started" size="lg">
<ButtonLink href="/apollo-server/getting-started" size="lg">
Get started!
</ButtonLink>
</div>
4 changes: 2 additions & 2 deletions docs/source/integrations/mern.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Teaching the MERN stack to speak GraphQL
title: Teaching the MERN Stack to Speak GraphQL
---

Apollo Server is designed to work seamlessly with MERN stack (MongoDB, Express, React, Node) applications. This tutorial shows how to add Apollo Server to an existing MERN stack project. Specifically, this tutorial demonstrates how to:
Expand All @@ -22,7 +22,7 @@ In your server folder, run the following command to install these packages and s
your server project's `node_modules` directory:

```bash
npm install graphql graphql-tag @apollo/subgraph @apollo/server
npm install graphql graphql-tag @apollo/subgraph @apollo/server
```

- [`graphql`](https://www.npmjs.com/package/graphql) is the JavaScript reference implementation for GraphQL
Expand Down
2 changes: 1 addition & 1 deletion docs/source/integrations/plugins-event-reference.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Apollo Server plugin event reference
title: Apollo Server Plugin Event Reference
---

> All plugin lifecycle methods are `async`, _except for [`willResolveField`](#willresolvefield) and [`schemaDidLoadOrUpdate`](#schemadidloadorupdate)_.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/integrations/plugins.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Creating Apollo Server plugins
title: Creating Apollo Server Plugins
description: Extend Apollo Server with custom functionality
---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/monitoring/health-checks.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Health checks
title: Health Checks
description: Determining the health status of Apollo Server
---

Expand Down
8 changes: 4 additions & 4 deletions docs/source/monitoring/metrics.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Metrics and logging
title: Metrics and Logging
description: How to monitor Apollo Server's performance
---

> Sending metrics from Apollo Server to GraphOS requires an [enterprise plan](../org/plans/).
> If your organization _doesn't_ currently have an Enterprise plan, you can test out this functionality by signing up for a free [Enterprise trial](https://studio.apollographql.com/signup?type=enterprise-trial&referrer=docs-content).
> Sending metrics from Apollo Server to GraphOS requires an [Enterprise plan](https://www.apollographql.com/pricing).
> If your organization doesn't have an Enterprise plan, you can test out this functionality by signing up for a free [GraphOS trial](https://studio.apollographql.com/signup?referrer=docs-content).
Apollo Server integrates seamlessly with [Apollo GraphOS](/graphos/) to help you monitor the execution of your GraphQL operations. Apollo Server additionally provides configurable mechanisms for logging each phase of a GraphQL operation.

> Using Federation? Check out the documentation for [federated tracing](/federation/metrics/).
## Sending metrics to GraphOS

[Apollo GraphOS](/graphos/) provides an integrated hub for all of your GraphQL performance data, which you can view in Apollo Studio. Studio [aggregates and displays information](/graphos/metrics/) for your schema, queries, requests, and errors. You can also configure alerts that support [Slack](/graphos/metrics/notifications/notification-setup/#slack) and [Datadog](/graphos/metrics/datadog-integration/) integrations.
[Apollo GraphOS](/graphos/) provides an integrated hub for all of your GraphQL performance data, which you can view in Apollo Studio. Studio [aggregates and displays information](/graphos/metrics/) for your schema, queries, requests, and errors. You can also configure alerts that support [Slack](/graphos/metrics/notifications/performance-alerts#slack) and [Datadog](/graphos/metrics/datadog-integration) integrations.

### Connecting to GraphOS

Expand Down
2 changes: 1 addition & 1 deletion docs/source/performance/apq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Automatic persisted queries
title: Automatic Persisted Queries
description: Improve network performance by sending smaller requests
---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/performance/cache-backends.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Configuring cache backends
title: Configuring Cache Backends
description: How to configure Apollo Server's cache
---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/performance/caching.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Server-side caching
title: Server-Side Caching
description: Configure caching behavior on a per-field basis
---

Expand Down
Loading

0 comments on commit 4afa612

Please sign in to comment.