Skip to content

Commit bebc4e6

Browse files
authored
update basic tutorial screenshots (#2856)
1 parent df9b456 commit bebc4e6

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed
77.9 KB
Loading
63.3 KB
Loading

website/src/pages/tutorial/basic/02-getting-started.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ These are our type definitions that describe what data can be retrieved from the
6363

6464
Up next you define the corresponding resolver functions that are used for resolving the data.
6565

66-
```ts
66+
```ts filename="src/schema.ts"
6767
const typeDefinitions = /* GraphQL */ `
6868
type Query {
6969
hello: String!
@@ -83,7 +83,7 @@ The typename (`Query`) is an object in which the fields (`hello`) are functions
8383

8484
Now you still need to glue together the type definitions and the resolver map.
8585

86-
```ts
86+
```ts filename="src/schema.ts"
8787
import { makeExecutableSchema } from '@graphql-tools/schema'
8888

8989
const typeDefinitions = /* GraphQL */ `

website/src/pages/tutorial/basic/06-adding-a-database.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Let's break down what's going on here with the numbered comments:
175175
Take a moment to re-type the query line and notice the helpful autocompletion you get after typing `prisma.` and `prisma.link.` which lets us see all the possible models we can
176176
access and operations we can use to query that data:
177177

178-
![typing prisma. and prisma.link.](https://i.imgur.com/Zrrqwmo.png)
178+
![typing prisma. and prisma.link.](/assets/tutorial/basic/06-adding-a-database/prisma-autocomplete-query.png)
179179

180180
So now let's see things in action.
181181

@@ -200,7 +200,7 @@ const newLink = await prisma.link.create({
200200
})
201201
```
202202

203-
![You successfully queried the database with Prisma Client](https://i.imgur.com/AUAtnxZ.png)
203+
![You successfully queried the database with Prisma Client](/assets/tutorial/basic/06-adding-a-database/prisma-autocomplete-mutation.png)
204204

205205
Great! Re-run the previous command and this time you should now see your newly created link print in the terminal output! Much more satisfying ✨
206206

website/src/pages/tutorial/basic/07-connecting-server-and-database.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Now, you'll need to import the `createContext` function and make sure you add it
3939
<details>
4040
<summary>v2</summary>
4141

42-
```typescript
42+
```typescript filename="src/main.ts"
4343
import { createServer } from '@graphql-yoga/node'
4444
import { schema } from './schema'
4545
import { createContext } from './context'
@@ -57,7 +57,7 @@ main()
5757
<details open>
5858
<summary>v3</summary>
5959

60-
```typescript
60+
```typescript filename="src/main.ts"
6161
import { createYoga } from 'graphql-yoga'
6262
import { createServer } from 'http'
6363
import { schema } from './schema'
@@ -164,7 +164,7 @@ Now let's understand how these new resolvers are working!
164164

165165
The `feed` resolver is implemented as follows:
166166

167-
```ts
167+
```ts filename="src/schema.ts"
168168
const resolvers = {
169169
Query: {
170170
// ...
@@ -184,7 +184,7 @@ Now, you should be able to imagine the complete system and workflow of a Prisma/
184184

185185
The `postLink` resolver now looks like this:
186186

187-
```ts
187+
```ts filename="src/schema.ts"
188188
const resolvers = {
189189
Mutation: {
190190
async postLink(

website/src/pages/tutorial/basic/08-graph-relations.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ This is the skeleton of your new field resolver. As you might notice, it looks a
120120

121121
Add the following business logic within the resolver, that uses the newly generated Prisma functions:
122122

123-
```ts
123+
```ts filename="src/schema.ts"
124124
const resolvers = {
125125
// ... other resolver maps ...
126126
Mutation: {
@@ -237,7 +237,7 @@ Instead, you will first create a resolver for retrieving a comment via its id.
237237

238238
Within the `Query` object type resolver map create a new `comment` field resolver function.
239239

240-
```ts
240+
```ts filename="src/schema.ts"
241241
const resolvers = {
242242
// ... other resolver maps ...
243243
Query: {
@@ -256,7 +256,7 @@ Within the resolver, you want to fetch the comment by its id.
256256

257257
Add the corresponding logic for retrieving a comment by its id.
258258

259-
```ts
259+
```ts filename="src/schema.ts"
260260
const resolvers = {
261261
// ... other resolver maps ...
262262
Query: {
@@ -351,7 +351,7 @@ Up next, you implement the corresponding `Link.comments` resolver. For this, you
351351

352352
Add the following `Link.resolvers` implementation:
353353

354-
```ts
354+
```ts filename="src/schema.ts"
355355
const resolvers = {
356356
// ... other resolver maps ...
357357
Link: {

website/src/pages/tutorial/basic/09-error-handling.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In this chapter, you will learn the origin of this error and learn how to proper
1111

1212
This is the resolver implementation that caused the issue when using a `linkId` that has no counter-part within the database.
1313

14-
```ts
14+
```ts filename="src/schema.ts"
1515
const resolvers = {
1616
// ... other resolver maps ...
1717
Mutation: {
@@ -132,7 +132,7 @@ For doing so you will use the `GraphQLYogaError` class that is exported from the
132132

133133
Add the following catch handler for mapping a foreign key error into a `GraphQLYogaError`:
134134

135-
```ts
135+
```ts filename="src/schema.ts"
136136
// ... other imports ...
137137
import { GraphQLYogaError } from '@graphql-yoga/node'
138138
// ... other imports ...
@@ -185,7 +185,7 @@ For doing so you will use the `GraphQLError` class that is exported from the `gr
185185

186186
Add the following catch handler for mapping a foreign key error into a `GraphQLError`:
187187

188-
```ts
188+
```ts filename="src/schema.ts"
189189
// ... other imports ...
190190
import { GraphQLError } from 'graphql'
191191
// ... other imports ...

website/src/pages/tutorial/basic/10-filtering-and-pagination.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Next, you need to update the implementation of the `Query.feed` resolver functio
3636

3737
Now, update the `Query.feed` resolver function to look as follows:
3838

39-
```ts
39+
```ts filename="src/schema.ts"
4040
const resolvers = {
4141
// ... other resolver maps ...
4242
Query: {
@@ -123,7 +123,7 @@ Now, adjust the field resolver function implementation:
123123

124124
And now adjust the implementation of the `Query.feed` resolver function:
125125

126-
```ts
126+
```ts filename="src/schema.ts"
127127
const resolvers = {
128128
// ... other resolvers maps ...
129129
Query: {
@@ -185,7 +185,7 @@ Adjust the current schema resolver implementation according to the following.
185185
<details>
186186
<summary>v2</summary>
187187

188-
```ts
188+
```ts filename="src/schema.ts"
189189
import { GraphQLYogaError } from '@graphql-yoga/node'
190190
// ... other code ...
191191

@@ -241,7 +241,7 @@ const resolvers = {
241241
<details open>
242242
<summary>v3</summary>
243243

244-
```ts
244+
```ts filename="src/schema.ts"
245245
// ... other code ...
246246
import { GraphQLError } from 'graphql'
247247

0 commit comments

Comments
 (0)