Skip to content
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

Merged
merged 3 commits into from
Jul 5, 2018
Merged

Conversation

evans
Copy link
Contributor

@evans evans commented Jun 28, 2018

Adds a section about Playground and how to enable in production

@ghost ghost added the 📝 documentation Focuses on changes to the documentation (docs) label Jun 28, 2018
@evans evans requested review from abernix and unicodeveloper June 28, 2018 18:40
@evans evans added this to the Release 2.0 milestone Jun 28, 2018
@@ -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.
Copy link
Contributor

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.

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
Copy link
Contributor

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.

@evans evans merged commit 02d3155 into version-2 Jul 5, 2018
@evans evans deleted the server-2.0/playground-docs branch July 5, 2018 23:17
Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @unicodeveloper @evans

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.
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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.

npm install --save apollo-server-express@rc graphql
```

Introspection and the gui can be enabled explicitly in the following manner.
Copy link
Member

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');
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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"

@unicodeveloper
Copy link
Contributor

These editorial changes are legit. LGTM @abernix

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📝 documentation Focuses on changes to the documentation (docs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants