@smartive/graphql-magic 15.2.0 → 15.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/docs/docs/tutorial.md +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## [15.2.1](https://github.com/smartive/graphql-magic/compare/v15.2.0...v15.2.1) (2024-04-03)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
* Finish
|
|
6
|
+
* Finish intro ([4ecc445](https://github.com/smartive/graphql-magic/commit/4ecc44575901cbe731dca7b70f109da6eaa847ba))
|
package/docs/docs/tutorial.md
CHANGED
|
@@ -17,7 +17,7 @@ npx create-next-app@latest magic-blog --ts --app --tailwind --eslint --src
|
|
|
17
17
|
cd magic-blog
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Replace `app/globals.css`:
|
|
20
|
+
Replace `src/app/globals.css`:
|
|
21
21
|
|
|
22
22
|
```
|
|
23
23
|
@tailwind base;
|
|
@@ -69,7 +69,7 @@ label span {
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
Replace `app/page.tsx`:
|
|
72
|
+
Replace `src/app/page.tsx`:
|
|
73
73
|
|
|
74
74
|
```
|
|
75
75
|
export default async function Home() {
|
|
@@ -140,7 +140,7 @@ Generate the first migration:
|
|
|
140
140
|
npx gqm generate-migration
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
Enter
|
|
143
|
+
Enter a migration name, e.g. "setup".
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
Run the migration
|
|
@@ -277,7 +277,7 @@ export default async function Home() {
|
|
|
277
277
|
|
|
278
278
|
### Content!
|
|
279
279
|
|
|
280
|
-
Let's
|
|
280
|
+
Let's make a blog out of this app by adding new models in `src/config/models.ts`:
|
|
281
281
|
|
|
282
282
|
```
|
|
283
283
|
{
|
|
@@ -333,7 +333,6 @@ Generate and run the new migrations and generate the new models:
|
|
|
333
333
|
```
|
|
334
334
|
npx gqm generate-migration
|
|
335
335
|
npx env-cmd knex migrate:up
|
|
336
|
-
npx gqm generate
|
|
337
336
|
```
|
|
338
337
|
|
|
339
338
|
Create a new query `src/graphql/client/queries/get-posts.ts`:
|
|
@@ -362,6 +361,12 @@ export const GET_POSTS = gql`
|
|
|
362
361
|
`;
|
|
363
362
|
```
|
|
364
363
|
|
|
364
|
+
Generate the new types:
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
npx gqm generate
|
|
368
|
+
```
|
|
369
|
+
|
|
365
370
|
Now add all the logic to create and display posts and comments to `src/app/page.tsx`
|
|
366
371
|
|
|
367
372
|
|