Skip to content

Commit

Permalink
Fixed Documentation Code Tags
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Dec 14, 2021
1 parent 774e363 commit 4377e16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In GraphQL, we have developed specific patterns around mutations. One foundation

> By convention, mutations are named as verbs, their inputs are the name with "Input" appended at the end, and they return an object that is the name with "Payload" appended.
```SDL
```sdl
type Mutation {
renameUser(input: RenameUserInput!): RenameUserPayload!
}
Expand All @@ -50,7 +50,7 @@ There are other reasons for this particular design. We, for instance, have a sin

A separate payload object allows us to expose all affected objects by the mutation. So that the client can fetch all the affected data, it is interested in. Further, the payload allows us to expose the user errors through just another field to the client.

```SDL
```sdl
type Mutation {
renameUser(input: RenameUserInput!): RenameUserPayload!
}
Expand Down Expand Up @@ -188,7 +188,7 @@ public class MutationType : ObjectType

**Schema-First**:

```SDL
```sdl
type Mutation {
renameUser(userId: ID!, username: String!): User
}
Expand Down Expand Up @@ -270,7 +270,7 @@ Easier Evolution

But at the same time, it wasn't easy to implement since it came with many moving parts. This meant that we had to write repetitive code again to fulfill this error pattern.

```SDL
```sdl
type Mutation {
renameUser(input: RenameUserInput!): RenameUserPayload!
}
Expand Down Expand Up @@ -325,7 +325,7 @@ public class Mutation

The above code will translate to the following schema:

```SDL
```sdl
type Mutation {
renameUser(input: RenameUserInput!): RenameUserPayload!
}
Expand Down
6 changes: 3 additions & 3 deletions website/src/docs/hotchocolate/defining-a-schema/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ services
In GraphQL, it is best practice to have a single argument on mutations called `input`, and each mutation should return a payload object.
The payload object allows to read the changes of the mutation or to access the domain errors caused by a mutation.

```graphql
```sdl
type Mutation {
updateUserName(input: UpdateUserNameInput!): UpdateUserNamePayload!
}
Expand Down Expand Up @@ -426,7 +426,7 @@ The HotChocolate schema is automatically rewritten, and an error middleware will

The configuration above emits the following schema:

```graphql
```sdl
type Mutation {
updateUserName(input: UpdateUserNameInput!): UpdateUserNamePayload!
}
Expand Down Expand Up @@ -966,7 +966,7 @@ Lastly, we can customize the error interface we want to use with our mutation co

By default, this error interface type is called `Error` and defines a non-nullable field `message`.

```graphql
```sdl
interface Error {
message: String!
}
Expand Down

0 comments on commit 4377e16

Please sign in to comment.