Skip to content

Delete src/pages/graphql-js directory #1945

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

Open
wants to merge 5 commits into
base: source
Choose a base branch
from
Open
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: 1 addition & 1 deletion src/code/language-support/javascript/server/graphql-js.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: GraphQL.js
description: The reference implementation of the GraphQL specification, designed for running GraphQL in a Node.js environment.
url: /graphql-js/
url: https://www.graphql-js.org/
github: graphql/graphql-js
npm: "graphql"
---
8 changes: 7 additions & 1 deletion src/pages/_meta.tsx
Original file line number Diff line number Diff line change
@@ -85,6 +85,12 @@ export default {
},
"graphql-js": {
type: "page",
title: "GraphQL.JS Tutorial",
title: (
<span className="after:font-sans after:content-['_↗']">
GraphQL.JS Tutorial
</span>
),
href: "https://www.graphql-js.org/docs/getting-started/",
newWindow: true,
},
}
2 changes: 1 addition & 1 deletion src/pages/faq/best-practices.mdx
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ You can implement authentication with common patterns, such as [OAuth](https://o

Some [GraphQL libraries](/code/#language-support) include a specific protocol for authentication as well. Although if you’re working with a pipeline model, we recommend that [GraphQL be placed after all authentication middleware](/learn/serving-over-http/#web-request-pipeline).

If you’re using [GraphQL.js](/graphql-js/) to build your API server, we have documentation on [handling authentication with Express middleware](/graphql-js/authentication-and-express-middleware/).
If you’re using [GraphQL.js](https://www.graphql-js.org/) to build your API server, we have documentation on [handling authentication with Express middleware](https://www.graphql-js.org/docs/authentication-and-express-middleware/).

## Is GraphQL the right fit for designing a microservice architecture?

2 changes: 1 addition & 1 deletion src/pages/faq/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -42,4 +42,4 @@ Before you start your learning journey, make sure you know [what an API is](http

No, not at all. [GraphQL is a specification](https://spec.graphql.org/) that can be [implemented in any language](/learn/schema/#type-language). Our [Code page](/code/) contains a long list of libraries in many different programming languages to help with that.

It’s understandable why you’d think this, though. GraphQL was introduced at a [React conference](https://www.youtube.com/watch?v=9sc8Pyc51uU) and [GraphQL.js](/graphql-js/) is one of the most widely used implementations to date. We know this can be confusing, so we’re working to improve our documentation and add more code samples that aren’t written in JavaScript.
It’s understandable why you’d think this, though. GraphQL was introduced at a [React conference](https://www.youtube.com/watch?v=9sc8Pyc51uU) and [GraphQL.js](https://www.graphql-js.org/) is one of the most widely used implementations to date. We know this can be confusing, so we’re working to improve our documentation and add more code samples that aren’t written in JavaScript.
31 changes: 0 additions & 31 deletions src/pages/graphql-js/_meta.ts

This file was deleted.

54 changes: 0 additions & 54 deletions src/pages/graphql-js/authentication-and-express-middleware.mdx

This file was deleted.

56 changes: 0 additions & 56 deletions src/pages/graphql-js/basic-types.mdx

This file was deleted.

117 changes: 0 additions & 117 deletions src/pages/graphql-js/constructing-types.mdx

This file was deleted.

104 changes: 0 additions & 104 deletions src/pages/graphql-js/error.mdx

This file was deleted.

58 changes: 0 additions & 58 deletions src/pages/graphql-js/execution.mdx

This file was deleted.

83 changes: 0 additions & 83 deletions src/pages/graphql-js/graphql-clients.mdx

This file was deleted.

39 changes: 0 additions & 39 deletions src/pages/graphql-js/graphql-http.mdx

This file was deleted.

172 changes: 0 additions & 172 deletions src/pages/graphql-js/graphql.mdx

This file was deleted.

70 changes: 0 additions & 70 deletions src/pages/graphql-js/index.mdx

This file was deleted.

295 changes: 0 additions & 295 deletions src/pages/graphql-js/language.mdx

This file was deleted.

191 changes: 0 additions & 191 deletions src/pages/graphql-js/mutations-and-input-types.mdx

This file was deleted.

142 changes: 0 additions & 142 deletions src/pages/graphql-js/object-types.mdx

This file was deleted.

128 changes: 0 additions & 128 deletions src/pages/graphql-js/passing-arguments.mdx

This file was deleted.

74 changes: 0 additions & 74 deletions src/pages/graphql-js/running-an-express-graphql-server.mdx

This file was deleted.

603 changes: 0 additions & 603 deletions src/pages/graphql-js/type.mdx

This file was deleted.

234 changes: 0 additions & 234 deletions src/pages/graphql-js/utilities.mdx

This file was deleted.

66 changes: 0 additions & 66 deletions src/pages/graphql-js/validation.mdx

This file was deleted.

4 changes: 2 additions & 2 deletions src/pages/learn/authorization.mdx
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<p className="learn-subtitle">Delegate authorization logic to the business logic layer</p>

Most APIs will need to secure access to certain types of data depending on who requested it, and GraphQL is no different. GraphQL execution should begin after [authentication](/graphql-js/authentication-and-express-middleware/) middleware confirms the user's identity and passes that information to the GraphQL layer. But after that, you still need to determine if the authenticated user is allowed to view the data provided by the specific fields that were included in the request. On this page, we'll explore how a GraphQL schema can support authorization.
Most APIs will need to secure access to certain types of data depending on who requested it, and GraphQL is no different. GraphQL execution should begin after [authentication](https://www.graphql-js.org/docs/authentication-and-express-middleware/) middleware confirms the user's identity and passes that information to the GraphQL layer. But after that, you still need to determine if the authenticated user is allowed to view the data provided by the specific fields that were included in the request. On this page, we'll explore how a GraphQL schema can support authorization.

## Type and field authorization

@@ -60,7 +60,7 @@ function Post_body(obj, args, context, info) {
}
```
In the example above, we see that the business logic layer requires the caller to provide a user object, which is available in the `context` object for the GraphQL request. We recommend passing a fully-hydrated user object instead of an opaque token or API key to your business logic layer. This way, we can handle the distinct concerns of [authentication](/graphql-js/authentication-and-express-middleware/) and authorization in different stages of the request processing pipeline.
In the example above, we see that the business logic layer requires the caller to provide a user object, which is available in the `context` object for the GraphQL request. We recommend passing a fully-hydrated user object instead of an opaque token or API key to your business logic layer. This way, we can handle the distinct concerns of [authentication](https://www.graphql-js.org/docs/authentication-and-express-middleware/) and authorization in different stages of the request processing pipeline.
## Using type system directives
2 changes: 1 addition & 1 deletion src/pages/learn/execution.mdx
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ This example is written in JavaScript, however GraphQL servers can be built in [
- `obj`: The previous object (for a field on the root `Query` type, this argument is often not used).
- `args`: The arguments provided to the field in the GraphQL operation.
- `context`: A value provided to every resolver that may hold important contextual information like the currently logged in user, or access to a database.
- `info`: generally only used in advanced use-cases, this is a value holding field-specific information relevant to the current operation as well as the schema details; refer to [type GraphQLResolveInfo](/graphql-js/type/#graphqlobjecttype) for more details.
- `info`: generally only used in advanced use-cases, this is a value holding field-specific information relevant to the current operation as well as the schema details; refer to [type GraphQLResolveInfo](https://www.graphql-js.org/api-v16/type/#graphqlobjecttype) for more details.

<Callout type="info">
Note that while a query operation could technically write data to the underlying data system during its execution, mutation operations are conventionally used for requests that produce side effects during their execution. And because mutation operations produce side effects, GraphQL implementations can be expected to execute these fields serially.