Skip to content

Commit 38ce813

Browse files
authored
Small improvements based on feedback (#7142)
This PR restructures the sidebar for a better reader experience and adds a note to the CORS docs to ensure folks don't get caught up when specifying origins as strings. :)
1 parent cf3b8a4 commit 38ce813

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

docs/source/config.json

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"title": "Apollo Server",
33
"version": "v4",
4-
"algoliaFilters": ["docset:apollo-server", ["docset:apollo-client", "docset:federation"]],
4+
"algoliaFilters": [
5+
"docset:apollo-server",
6+
["docset:apollo-client", "docset:federation"]
7+
],
58
"sidebar": {
69
"Introduction": "/",
710
"Get started": "/getting-started",
@@ -15,14 +18,16 @@
1518
"Custom scalars": "/schema/custom-scalars",
1619
"Directives": "/schema/directives"
1720
},
18-
"Fetching Data": {
21+
"Resolving Operations": {
1922
"Resolvers": "/data/resolvers",
20-
"Fetching data": "/data/fetching-data",
21-
"Fetching from REST": "/data/fetching-rest",
2223
"Error handling": "/data/errors",
2324
"Subscriptions": "/data/subscriptions"
2425
},
25-
"Web frameworks": {
26+
"Fetching Data": {
27+
"Overview": "/data/fetching-data",
28+
"REST APIs": "/data/fetching-rest"
29+
},
30+
"Web Frameworks": {
2631
"Integrations": "/integrations/integration-index",
2732
"Building integrations": "/integrations/building-integrations"
2833
},
@@ -60,18 +65,20 @@
6065
"@apollo/subgraph": "https://www.apollographql.com/docs/federation/api/apollo-subgraph/",
6166
"@apollo/gateway": "https://www.apollographql.com/docs/federation/api/apollo-gateway/"
6267
},
63-
"Built-in Plugins": {
68+
"Plugins": {
6469
"Overview": "/builtin-plugins",
65-
"Usage reporting": "/api/plugin/usage-reporting",
66-
"Schema reporting": "/api/plugin/schema-reporting",
67-
"Inline trace": "/api/plugin/inline-trace",
68-
"Drain HTTP server": "/api/plugin/drain-http-server",
69-
"Cache control": "/api/plugin/cache-control",
70-
"Landing pages": "/api/plugin/landing-pages"
71-
},
72-
"Custom Plugins": {
73-
"Creating plugins": "/integrations/plugins",
74-
"Event reference": "/integrations/plugins-event-reference"
70+
"Built-in": {
71+
"Usage reporting": "/api/plugin/usage-reporting",
72+
"Schema reporting": "/api/plugin/schema-reporting",
73+
"Inline trace": "/api/plugin/inline-trace",
74+
"Drain HTTP server": "/api/plugin/drain-http-server",
75+
"Cache control": "/api/plugin/cache-control",
76+
"Landing pages": "/api/plugin/landing-pages"
77+
},
78+
"Custom": {
79+
"Creating plugins": "/integrations/plugins",
80+
"Event reference": "/integrations/plugins-event-reference"
81+
}
7582
}
7683
}
7784
}

docs/source/data/fetching-data.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Fetching Data
2+
title: Fetching data
33
description: Manage connections to databases and other data sources
44
---
55

6-
import TopLevelAwait from "../shared/top-level-await.mdx"
6+
import TopLevelAwait from '../shared/top-level-await.mdx';
77

88
> Looking to fetch data from a REST API? Check out [Fetching from REST](./fetching-rest).
99

docs/source/security/cors.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ console.log(`🚀 Server ready at http://localhost:4000/graphql`);
137137

138138
> Invoking the `cors` function with no arguments sets your server's `Access-Control-Allow-Origin` HTTP header to the wildcard value (`*`), allowing scripts on any origin to make requests. So, your server would have the same CORS behavior as `startStandaloneServer`.
139139
140-
Using the `cors` package directly, we can configure the `Access-Control-Allow-Origin` header using the [`origin` option](https://github.com/expressjs/cors#configuration-options). The example above enables CORS requests from `https://www.your-app.example`, along with `https://studio.apollographql.com`.
140+
Using the `cors` package directly, we can configure the `Access-Control-Allow-Origin` header using the [`origin` option](https://github.com/expressjs/cors#configuration-options). The example above enables CORS requests from `https://www.your-app.example`, along with `https://studio.apollographql.com`. If you use a string to specify the URL of an allowed origin, that string must match your client's URL exactly (e.g., `http://example.com` is *not* the same as `http://example.com/`).
141141

142-
> Note: if you plan to use [Apollo Studio Explorer](https://www.apollographql.com/docs/studio/explorer/explorer/) as a GraphQL web IDE, you should include `https://studio.apollographql.com` in your list of valid origins. However, if you plan to embed the [Explorer](https://www.apollographql.com/docs/studio/explorer/embed-explorer/) or use [Apollo Sandbox](https://www.apollographql.com/docs/studio/explorer/sandbox), you *don't* need to specify Studio's URL in your CORS origins because requests will go through the page embedding Studio.
142+
> If you want to use [Apollo Studio Explorer](https://www.apollographql.com/docs/studio/explorer/explorer/) as a GraphQL web IDE, you should include `https://studio.apollographql.com` in your list of valid origins. However, if you plan to embed the [Explorer](https://www.apollographql.com/docs/studio/explorer/embed-explorer/) or use [Apollo Sandbox](https://www.apollographql.com/docs/studio/explorer/sandbox), you *don't* need to specify Studio's URL in your CORS origins because requests will go through the page embedding Studio.
143143
144144
If you're using another integration of Apollo Server, you can add and configure CORS for your server using your framework's standard functionality.
145145

0 commit comments

Comments
 (0)