Skip to content

Commit 17b4f55

Browse files
byronlanehillveryspryLekoArts
authored
BREAKING CHANGE(gatsby-source-shopify): Rewrite for media, presentment, schema, etc. (#34049)
Co-authored-by: Matt Ehlinger <ehlinger.matt@gmail.com> Co-authored-by: LekoArts <lekoarts@gmail.com>
1 parent d278739 commit 17b4f55

File tree

81 files changed

+14154
-2776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+14154
-2776
lines changed

packages/gatsby-source-shopify/README.md

Lines changed: 297 additions & 132 deletions
Large diffs are not rendered by default.

packages/gatsby-source-shopify/__tests__/__snapshots__/create-operations.ts.snap

Lines changed: 2657 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`createResolvers Sets the correct resolvers with downloadImages and with connections 1`] = `
4+
Array [
5+
Array [
6+
Object {
7+
"__PREFIX__ShopifyCollection": Object {
8+
"metafield": Object {
9+
"resolve": [Function],
10+
},
11+
},
12+
},
13+
],
14+
Array [
15+
Object {
16+
"__PREFIX__ShopifyProduct": Object {
17+
"metafield": Object {
18+
"resolve": [Function],
19+
},
20+
},
21+
},
22+
],
23+
Array [
24+
Object {
25+
"__PREFIX__ShopifyProductVariant": Object {
26+
"metafield": Object {
27+
"resolve": [Function],
28+
},
29+
},
30+
},
31+
],
32+
]
33+
`;
34+
35+
exports[`createResolvers Sets the correct resolvers with downloadImages and without connections 1`] = `
36+
Array [
37+
Array [
38+
Object {
39+
"__PREFIX__ShopifyProduct": Object {
40+
"metafield": Object {
41+
"resolve": [Function],
42+
},
43+
},
44+
},
45+
],
46+
Array [
47+
Object {
48+
"__PREFIX__ShopifyProductVariant": Object {
49+
"metafield": Object {
50+
"resolve": [Function],
51+
},
52+
},
53+
},
54+
],
55+
]
56+
`;
57+
58+
exports[`createResolvers Sets the correct resolvers without downloadImages and with connections 1`] = `
59+
Array [
60+
Array [
61+
Object {
62+
"__PREFIX__ShopifyImage": Object {
63+
"gatsbyImageData": Object {
64+
"args": Object {
65+
"aspectRatio": Object {
66+
"description": "If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.
67+
If neither width or height is provided, height will be set based on the intrinsic width of the source image.",
68+
"type": "Float",
69+
},
70+
"backgroundColor": Object {
71+
"description": "Background color applied to the wrapper, or when \\"letterboxing\\" an image to another aspect ratio.",
72+
"type": "String",
73+
},
74+
"breakpoints": Object {
75+
"description": "Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,
76+
based on the image size. For FULL_WIDTH images this can be used to override the default, which is [750, 1080, 1366, 1920].
77+
It will never generate any images larger than the source.",
78+
"type": "[Int]",
79+
},
80+
"formats": Object {
81+
"defaultValue": Array [
82+
"",
83+
"webp",
84+
],
85+
"description": "The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.
86+
The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do
87+
not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying
88+
both PNG and JPG is not supported and will be ignored.",
89+
"type": "[GatsbyImageFormat]",
90+
},
91+
"height": Object {
92+
"description": "If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image.",
93+
"type": "Int",
94+
},
95+
"layout": Object {
96+
"description": "The layout for the image.
97+
FIXED: A static image sized, that does not resize according to the screen width
98+
FULL_WIDTH: The image resizes to fit its container. Pass a \\"sizes\\" option if it isn't going to be the full width of the screen.
99+
CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.",
100+
"type": "GatsbyImageLayout",
101+
},
102+
"outputPixelDensities": Object {
103+
"description": "A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.
104+
Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.",
105+
"type": "[Float]",
106+
},
107+
"placeholder": Object {
108+
"description": "Format of generated placeholder image, displayed while the main image loads.
109+
BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)
110+
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.
111+
TRACED_SVG: a low-resolution traced SVG of the image.
112+
NONE: no placeholder. Set the argument \\"backgroundColor\\" to use a fixed background color.",
113+
"type": "GatsbyImagePlaceholder",
114+
},
115+
"sizes": Object {
116+
"description": "The \\"sizes\\" property, passed to the img tag. This describes the display size of the image.
117+
This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image
118+
container will be the full width of the screen. In these cases we will generate an appropriate value.",
119+
"type": "String",
120+
},
121+
"width": Object {
122+
"description": "The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.
123+
The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities
124+
Ignored if layout = FLUID.",
125+
"type": "Int",
126+
},
127+
},
128+
"resolve": [Function],
129+
"type": "JSON",
130+
},
131+
},
132+
},
133+
],
134+
Array [
135+
Object {
136+
"__PREFIX__ShopifyCollection": Object {
137+
"metafield": Object {
138+
"resolve": [Function],
139+
},
140+
},
141+
},
142+
],
143+
Array [
144+
Object {
145+
"__PREFIX__ShopifyProduct": Object {
146+
"metafield": Object {
147+
"resolve": [Function],
148+
},
149+
},
150+
},
151+
],
152+
Array [
153+
Object {
154+
"__PREFIX__ShopifyProductVariant": Object {
155+
"metafield": Object {
156+
"resolve": [Function],
157+
},
158+
},
159+
},
160+
],
161+
]
162+
`;
163+
164+
exports[`createResolvers Sets the correct resolvers without downloadImages and without connections 1`] = `
165+
Array [
166+
Array [
167+
Object {
168+
"__PREFIX__ShopifyImage": Object {
169+
"gatsbyImageData": Object {
170+
"args": Object {
171+
"aspectRatio": Object {
172+
"description": "If set along with width or height, this will set the value of the other dimension to match the provided aspect ratio, cropping the image if needed.
173+
If neither width or height is provided, height will be set based on the intrinsic width of the source image.",
174+
"type": "Float",
175+
},
176+
"backgroundColor": Object {
177+
"description": "Background color applied to the wrapper, or when \\"letterboxing\\" an image to another aspect ratio.",
178+
"type": "String",
179+
},
180+
"breakpoints": Object {
181+
"description": "Specifies the image widths to generate. You should rarely need to change this. For FIXED and CONSTRAINED images it is better to allow these to be determined automatically,
182+
based on the image size. For FULL_WIDTH images this can be used to override the default, which is [750, 1080, 1366, 1920].
183+
It will never generate any images larger than the source.",
184+
"type": "[Int]",
185+
},
186+
"formats": Object {
187+
"defaultValue": Array [
188+
"",
189+
"webp",
190+
],
191+
"description": "The image formats to generate. Valid values are AUTO (meaning the same format as the source image), JPG, PNG, WEBP and AVIF.
192+
The default value is [AUTO, WEBP], and you should rarely need to change this. Take care if you specify JPG or PNG when you do
193+
not know the formats of the source images, as this could lead to unwanted results such as converting JPEGs to PNGs. Specifying
194+
both PNG and JPG is not supported and will be ignored.",
195+
"type": "[GatsbyImageFormat]",
196+
},
197+
"height": Object {
198+
"description": "If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image.",
199+
"type": "Int",
200+
},
201+
"layout": Object {
202+
"description": "The layout for the image.
203+
FIXED: A static image sized, that does not resize according to the screen width
204+
FULL_WIDTH: The image resizes to fit its container. Pass a \\"sizes\\" option if it isn't going to be the full width of the screen.
205+
CONSTRAINED: Resizes to fit its container, up to a maximum width, at which point it will remain fixed in size.",
206+
"type": "GatsbyImageLayout",
207+
},
208+
"outputPixelDensities": Object {
209+
"description": "A list of image pixel densities to generate for FIXED and CONSTRAINED images. You should rarely need to change this. It will never generate images larger than the source, and will always include a 1x image.
210+
Default is [ 1, 2 ] for fixed images, meaning 1x, 2x, 3x, and [0.25, 0.5, 1, 2] for fluid. In this case, an image with a fluid layout and width = 400 would generate images at 100, 200, 400 and 800px wide.",
211+
"type": "[Float]",
212+
},
213+
"placeholder": Object {
214+
"description": "Format of generated placeholder image, displayed while the main image loads.
215+
BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default)
216+
DOMINANT_COLOR: a solid color, calculated from the dominant color of the image.
217+
TRACED_SVG: a low-resolution traced SVG of the image.
218+
NONE: no placeholder. Set the argument \\"backgroundColor\\" to use a fixed background color.",
219+
"type": "GatsbyImagePlaceholder",
220+
},
221+
"sizes": Object {
222+
"description": "The \\"sizes\\" property, passed to the img tag. This describes the display size of the image.
223+
This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image
224+
container will be the full width of the screen. In these cases we will generate an appropriate value.",
225+
"type": "String",
226+
},
227+
"width": Object {
228+
"description": "The display width of the generated image for layout = FIXED, and the display width of the largest image for layout = CONSTRAINED.
229+
The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities
230+
Ignored if layout = FLUID.",
231+
"type": "Int",
232+
},
233+
},
234+
"resolve": [Function],
235+
"type": "JSON",
236+
},
237+
},
238+
},
239+
],
240+
Array [
241+
Object {
242+
"__PREFIX__ShopifyProduct": Object {
243+
"metafield": Object {
244+
"resolve": [Function],
245+
},
246+
},
247+
},
248+
],
249+
Array [
250+
Object {
251+
"__PREFIX__ShopifyProductVariant": Object {
252+
"metafield": Object {
253+
"resolve": [Function],
254+
},
255+
},
256+
},
257+
],
258+
]
259+
`;

0 commit comments

Comments
 (0)