-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GraphQL Playground Documentation #1270
Conversation
docs/source/whats-new.md
Outdated
@@ -170,7 +170,7 @@ server.listen().then(({ url }) => { | |||
``` | |||
|
|||
|
|||
## GraphQL Playground | |||
## [GraphQL Playground](./features/playground.html) | |||
|
|||
Apollo Server 2.0 creates a single GraphQL endpoint that provides data and a gui explorer depending on how the endpoint is accessed. In browser, Apollo Server returns GraphQL playground. For other cases, Apollo server returns the data for a GraphQL requests from other clients, such as Apollo Client, curl, Postman, or Insomnia. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...for a GraphQL requests from other clients..
=>
please remove the a
.
docs/source/features/playground.md
Outdated
To enable Playground in production, an integration package must be installed to provide more control over the middlewares used. The following example uses the express integration: | ||
|
||
```bash | ||
npm uninstall --save apollo-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend that we do not show the uninstallation of apollo-server. It's really not needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some editorial changes that I think should still be done to this. Let me know what you think — I've opened #1319 with the changes I'm suggesting here.
description: Visually exploring a Apollo Server | ||
--- | ||
|
||
[GraphQL Playground](https://github.com/prismagraphql/graphql-playground) is a graphical interactive in-browser GraphQL IDE, created by [Prisma](https://www.prisma.io/), based on [GraphiQL](https://github.com/graphql/graphiql). In development, Apollo Server collocates a GraphQL Playground instance with the GraphQL path. When a browser sends a request to Apollo Server, it receives the GraphQL Playground gui. When `NODE_ENV` is set to production, introspection and Playground are disabled as a production best practice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be capitalizing the acronym "GUI" whenever it's being used.
description: Visually exploring a Apollo Server | ||
--- | ||
|
||
[GraphQL Playground](https://github.com/prismagraphql/graphql-playground) is a graphical interactive in-browser GraphQL IDE, created by [Prisma](https://www.prisma.io/), based on [GraphiQL](https://github.com/graphql/graphiql). In development, Apollo Server collocates a GraphQL Playground instance with the GraphQL path. When a browser sends a request to Apollo Server, it receives the GraphQL Playground gui. When `NODE_ENV` is set to production, introspection and Playground are disabled as a production best practice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
graphical interactive in-browser GraphQL IDE
should be graphical, interactive, in-browser GraphQL IDE
.
description: Visually exploring a Apollo Server | ||
--- | ||
|
||
[GraphQL Playground](https://github.com/prismagraphql/graphql-playground) is a graphical interactive in-browser GraphQL IDE, created by [Prisma](https://www.prisma.io/), based on [GraphiQL](https://github.com/graphql/graphiql). In development, Apollo Server collocates a GraphQL Playground instance with the GraphQL path. When a browser sends a request to Apollo Server, it receives the GraphQL Playground gui. When `NODE_ENV` is set to production, introspection and Playground are disabled as a production best practice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "production" should be in code-ticks here since it's the exact string the developer should be setting their NODE_ENV
environment variable to.
docs/source/features/playground.md
Outdated
npm install --save apollo-server-express@rc graphql | ||
``` | ||
|
||
Introspection and the gui can be enabled explicitly in the following manner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acronyms, such as "GUI", should be capitalized.
Introspection and the gui can be enabled explicitly in the following manner. | ||
|
||
```js line=8,16 | ||
const { ApolloServer, gql } = require('apollo-server-express'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge deal, but this example doesn't need to import gql
, since it doesn't use it.
|
||
const app = express(); | ||
|
||
// gui accepts a Playground configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does gui
still accept a Playground configuration?
![GraphQL Playground](../images/playground.png) | ||
</div> | ||
|
||
## Enabling Playground in Production |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't thin we should shorten "GraphQL Playground" to "Playground" — even if we did, we should do it consistently. Its correct name is "GraphQL Playground".
@@ -0,0 +1,45 @@ | |||
--- | |||
title: GraphQL Playground | |||
description: Visually exploring a Apollo Server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be "an Apollo Server"
These editorial changes are legit. LGTM @abernix |
Adds a section about Playground and how to enable in production