Skip to content

Commit b568ee8

Browse files
feat: Gatsby v4 (#218)
* feat: add support for Gatsby v4 (#206) * ci: change node version to 14 * fix: remove return null (#215) * fix: revert remove return null 215 This reverts commit 4939c84. * fix: allow nullable gatsbyImageData (#217) * chore: add additional fragments * fix: use newer dependencies * chore: use github actions v2 * fix: temp explicit rich text typenames * docs: update readme * fix: detect RichText automatically to create types * docs(README): add note on Bad Request * chore: cleanup demo Product fragment * docs: add note about gatsby v4 (#207) * feat: add support for Gatsby v4 (#206) * docs(README): update install instructions * fix: merge conflict * docs(README): contributing note * chore: fix contributors rc Co-authored-by: João Pedro Schmitz <[email protected]>
1 parent f4a943e commit b568ee8

18 files changed

+4041
-6138
lines changed

.all-contributorsrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
],
55
"imageSize": 100,
66
"commit": false,
7-
"badgeTemplate": `<img src="https://img.shields.io/badge/all_contributors-1-purple.svg" alt="Contributors" />`,
7+
"badgeTemplate": "<img src=\"https://img.shields.io/badge/all_contributors-1-purple.svg\" alt=\"Contributors\" />",
88
"contributors": [
99
{
1010
"login": "ynnoj",

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
runs-on: ubuntu-18.04
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v1
13+
uses: actions/checkout@v2
1414
- name: Setup Node.js
1515
uses: actions/setup-node@v1
1616
with:
17-
node-version: 12
17+
node-version: 14
1818
- name: Install dependencies
1919
run: yarn
2020
- name: Build

demo/.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.15

demo/graphcms-fragments/Asset.graphql

+29
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,40 @@ fragment Asset on Asset {
1111
width
1212
size
1313
mimeType
14+
createdBy {
15+
... on User {
16+
remoteTypeName: __typename
17+
remoteId: id
18+
stage
19+
}
20+
}
21+
updatedBy {
22+
... on User {
23+
remoteTypeName: __typename
24+
remoteId: id
25+
stage
26+
}
27+
}
28+
publishedBy {
29+
... on User {
30+
remoteTypeName: __typename
31+
remoteId: id
32+
stage
33+
}
34+
}
1435
productImages {
1536
... on Product {
1637
remoteTypeName: __typename
1738
remoteId: id
1839
locale
40+
stage
41+
}
42+
}
43+
scheduledIn {
44+
... on ScheduledOperation {
45+
remoteTypeName: __typename
46+
remoteId: id
47+
stage
1948
}
2049
}
2150
url

demo/graphcms-fragments/Category.graphql

+29
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,40 @@ fragment Category on Category {
66
updatedAt(variation: COMBINED)
77
publishedAt(variation: COMBINED)
88
name
9+
createdBy {
10+
... on User {
11+
remoteTypeName: __typename
12+
remoteId: id
13+
stage
14+
}
15+
}
16+
updatedBy {
17+
... on User {
18+
remoteTypeName: __typename
19+
remoteId: id
20+
stage
21+
}
22+
}
23+
publishedBy {
24+
... on User {
25+
remoteTypeName: __typename
26+
remoteId: id
27+
stage
28+
}
29+
}
930
products {
1031
... on Product {
1132
remoteTypeName: __typename
1233
remoteId: id
1334
locale
35+
stage
36+
}
37+
}
38+
scheduledIn {
39+
... on ScheduledOperation {
40+
remoteTypeName: __typename
41+
remoteId: id
42+
stage
1443
}
1544
}
1645
}

demo/graphcms-fragments/Product.graphql

+52-1
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,77 @@ fragment Product on Product {
88
name
99
slug
1010
description {
11-
... on RichText {
11+
... on ProductDescriptionRichText {
1212
raw
13+
json
1314
html
1415
markdown
1516
text
17+
references {
18+
... on Asset {
19+
remoteTypeName: __typename
20+
remoteId: id
21+
locale
22+
stage
23+
}
24+
... on Category {
25+
remoteTypeName: __typename
26+
remoteId: id
27+
locale
28+
stage
29+
}
30+
... on Product {
31+
remoteTypeName: __typename
32+
remoteId: id
33+
locale
34+
stage
35+
}
36+
}
1637
}
1738
}
1839
price
40+
createdBy {
41+
... on User {
42+
remoteTypeName: __typename
43+
remoteId: id
44+
stage
45+
}
46+
}
47+
updatedBy {
48+
... on User {
49+
remoteTypeName: __typename
50+
remoteId: id
51+
stage
52+
}
53+
}
54+
publishedBy {
55+
... on User {
56+
remoteTypeName: __typename
57+
remoteId: id
58+
stage
59+
}
60+
}
1961
images {
2062
... on Asset {
2163
remoteTypeName: __typename
2264
remoteId: id
2365
locale
66+
stage
2467
}
2568
}
2669
categories {
2770
... on Category {
2871
remoteTypeName: __typename
2972
remoteId: id
3073
locale
74+
stage
75+
}
76+
}
77+
scheduledIn {
78+
... on ScheduledOperation {
79+
remoteTypeName: __typename
80+
remoteId: id
81+
stage
3182
}
3283
}
3384
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
fragment ScheduledOperation on ScheduledOperation {
2+
stage
3+
remoteId: id
4+
createdAt
5+
updatedAt
6+
publishedAt
7+
description
8+
errorMessage
9+
rawPayload
10+
createdBy {
11+
... on User {
12+
remoteTypeName: __typename
13+
remoteId: id
14+
stage
15+
}
16+
}
17+
updatedBy {
18+
... on User {
19+
remoteTypeName: __typename
20+
remoteId: id
21+
stage
22+
}
23+
}
24+
publishedBy {
25+
... on User {
26+
remoteTypeName: __typename
27+
remoteId: id
28+
stage
29+
}
30+
}
31+
release {
32+
... on ScheduledRelease {
33+
remoteTypeName: __typename
34+
remoteId: id
35+
stage
36+
}
37+
}
38+
status
39+
affectedDocuments {
40+
... on Asset {
41+
remoteTypeName: __typename
42+
remoteId: id
43+
locale
44+
stage
45+
}
46+
... on Category {
47+
remoteTypeName: __typename
48+
remoteId: id
49+
locale
50+
stage
51+
}
52+
... on Product {
53+
remoteTypeName: __typename
54+
remoteId: id
55+
locale
56+
stage
57+
}
58+
}
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
fragment ScheduledRelease on ScheduledRelease {
2+
stage
3+
remoteId: id
4+
createdAt
5+
updatedAt
6+
publishedAt
7+
title
8+
description
9+
errorMessage
10+
isActive
11+
isImplicit
12+
releaseAt
13+
createdBy {
14+
... on User {
15+
remoteTypeName: __typename
16+
remoteId: id
17+
stage
18+
}
19+
}
20+
updatedBy {
21+
... on User {
22+
remoteTypeName: __typename
23+
remoteId: id
24+
stage
25+
}
26+
}
27+
publishedBy {
28+
... on User {
29+
remoteTypeName: __typename
30+
remoteId: id
31+
stage
32+
}
33+
}
34+
operations {
35+
... on ScheduledOperation {
36+
remoteTypeName: __typename
37+
remoteId: id
38+
stage
39+
}
40+
}
41+
status
42+
}

demo/graphcms-fragments/User.graphql

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ fragment User on User {
66
publishedAt
77
name
88
picture
9-
kind
109
isActive
10+
kind
1111
}

demo/package.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@
66
"build": "gatsby build",
77
"clean": "gatsby clean",
88
"preinstall": "cd ../gatsby-source-graphcms && yarn build",
9-
"dev": "gatsby develop"
9+
"dev": "gatsby develop",
10+
"serve": "gatsby serve"
1011
},
1112
"dependencies": {
1213
"@mdx-js/mdx": "1.6.22",
1314
"@mdx-js/react": "1.6.22",
14-
"gatsby": "3.4.1",
15-
"gatsby-plugin-image": "1.4.0",
16-
"gatsby-plugin-mdx": "2.4.0",
17-
"gatsby-plugin-postcss": "4.4.0",
18-
"gatsby-plugin-sharp": "3.4.1",
15+
"gatsby": "4.4.0",
16+
"gatsby-plugin-image": "2.4.0",
17+
"gatsby-plugin-mdx": "3.4.0",
18+
"gatsby-plugin-postcss": "5.4.0",
19+
"gatsby-plugin-sharp": "4.4.0",
1920
"gatsby-source-graphcms": "2.0.0",
2021
"react": "17.0.2",
2122
"react-dom": "17.0.2"
2223
},
2324
"devDependencies": {
24-
"babel-preset-gatsby": "1.4.0",
25-
"postcss-preset-env": "6.7.0",
26-
"tailwindcss": "1.9.6"
25+
"babel-preset-gatsby": "^2.4.0",
26+
"postcss-preset-env": "7.2.0",
27+
"tailwindcss": "3.0.12"
2728
}
2829
}

demo/postcss.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports = {
2-
plugins: [require('postcss-preset-env'), require('tailwindcss')],
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
36
}

demo/tailwind.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
purge: [
2+
content: [
33
'./src/components/**/*.js',
44
'./src/pages/**/*.js',
55
'./src/templates/**/*.js',

gatsby-source-graphcms/.babelrc

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
}
1010
]
1111
],
12-
"plugins": [
13-
"@babel/plugin-transform-runtime"
14-
],
12+
"plugins": ["@babel/plugin-transform-runtime"],
1513
"only": ["src/", "test/"]
16-
}
14+
}

0 commit comments

Comments
 (0)