Skip to content

Commit

Permalink
docs: Fix typos in graphql.md
Browse files Browse the repository at this point in the history
  • Loading branch information
LorianeE committed May 11, 2020
1 parent b5aca9f commit 08d2313
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/tutorials/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ meta:
## Feature

Currently, `@tsed/graphql` allows you to configure a graphql server in your project.
This package use [`apollo-server-express`](https://www.apollographql.com/docs/apollo-server/api/apollo-server.html) to create GraphQL server and [`type-graphql`](https://19majkel94.github.io/type-graphql/)
This package uses [`apollo-server-express`](https://www.apollographql.com/docs/apollo-server/api/apollo-server.html) to create GraphQL server and [`type-graphql`](https://19majkel94.github.io/type-graphql/)
for the decorators.

## Installation
Expand All @@ -24,7 +24,7 @@ To begin, install the GraphQL module for TS.ED:
npm install --save @tsed/graphql
```

[Type-graphql](https://19majkel94.github.io/type-graphql/) require to update your `tsconfig.json` by adding extra options as following:
[Type-graphql](https://19majkel94.github.io/type-graphql/) requires to update your `tsconfig.json` by adding extra options as following:

```json
{
Expand All @@ -40,16 +40,16 @@ Now, we can configure the Ts.ED server by importing `@tsed/graphql` in your [Ser

## GraphQlService

GraphQlService let you to retrieve an instance of ApolloServer.
GraphQlService lets you to retrieve an instance of ApolloServer.

<<< @/docs/tutorials/snippets/graphql/get-server-instance.ts

For more information about ApolloServer look his documentation [here](https://www.apollographql.com/docs/apollo-server/api/apollo-server.html);
For more information about ApolloServer, look its documentation [here](https://www.apollographql.com/docs/apollo-server/api/apollo-server.html);

## Type-graphql
### Types

We want to get equivalent of this type described in SDL:
We want to get the equivalent of this type described in SDL:

```
type Recipe {
Expand All @@ -74,22 +74,22 @@ class Recipe {
}
```

Then we decorate the class and it properties with decorators:
Then we decorate the class and its properties with decorators:

<<< @/docs/tutorials/snippets/graphql/recipe-type-graphql.ts

The detailed rules when to use nullable, array and others are described in [fields and types docs](https://19majkel94.github.io/type-graphql/docs/types-and-fields.html).
The detailed rules for when to use nullable, array and others are described in [fields and types docs](https://19majkel94.github.io/type-graphql/docs/types-and-fields.html).

### Resolvers

After that we want to create typical crud queries and mutation. To do that we create the resolver (controller) class that will have injected RecipeService in constructor:
After that we want to create typical crud queries and mutation. To do that we create the resolver (controller) class that will have injected RecipeService in the constructor:

<<< @/docs/tutorials/snippets/graphql/resolver-service.ts

### Data Source

Data sources is one of the Apollo server feature which can be used as option for your Resolver or Query.
Ts.ED provide a @@DataSourceService@@ decorator to declare a DataSource which will be injected to the apollo server context.
Data source is one of the Apollo server features which can be used as option for your Resolver or Query.
Ts.ED provides a @@DataSourceService@@ decorator to declare a DataSource which will be injected to the Apollo server context.

<<< @/docs/tutorials/snippets/graphql/datasource-service.ts

Expand Down

0 comments on commit 08d2313

Please sign in to comment.