You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65Lines changed: 65 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -533,6 +533,71 @@ Re-saving many images at a time can be intensive, and on certain setups may requ
533
533
534
534
All you need to do is install the plugin, and any queue jobs in Craft CMS 3 will now run entirely in the background via the CLI php, which isn't subject to the same restrictions that the web php is.
535
535
536
+
### GraphQL via CraftQL Plugin
537
+
538
+
ImageOptimize has built-in support for accessing the OptimizedImages field via GraphQL using the [CraftQL plugin](https://github.com/markhuot/craftql).
539
+
540
+
You can access all of the primary OptimizeImages methods:
541
+
542
+
```
543
+
{
544
+
entries(section:[homepage], limit:1) {
545
+
...on Homepage {
546
+
title
547
+
url
548
+
someAsset {
549
+
...on AssetsVolume {
550
+
title
551
+
optimizedImages {
552
+
...on OptimizedImagesData {
553
+
src,
554
+
srcset,
555
+
srcWebp,
556
+
srcsetWebp,
557
+
maxSrcsetWidth,
558
+
placeholderImage,
559
+
placeholderBox,
560
+
placeholderSilhouette
561
+
}
562
+
}
563
+
}
564
+
}
565
+
}
566
+
}
567
+
}
568
+
```
569
+
570
+
...as well as all of the object properties:
571
+
572
+
```
573
+
entries(section:[homepage], limit:1) {
574
+
...on Homepage {
575
+
title
576
+
url
577
+
someAsset {
578
+
...on AssetsVolume {
579
+
title
580
+
optimizedImages {
581
+
...on OptimizedImagesData {
582
+
optimizedImageUrls,
583
+
optimizedWebPImageUrls,
584
+
variantSourceWidths,
585
+
originalImageWidth,
586
+
originalImageHeight
587
+
placeholder,
588
+
placeholderSvg,
589
+
colorPalette,
590
+
placeholderWidth,
591
+
placeholderHeight
592
+
}
593
+
}
594
+
}
595
+
}
596
+
}
597
+
}
598
+
}
599
+
```
600
+
536
601
## Using Optimized Image Transforms
537
602
538
603
Once ImageOptimize is set up and configured, there's nothing left to do for optimizing your image transforms. It just works.
Copy file name to clipboardExpand all lines: composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "nystudio107/craft-imageoptimize",
3
3
"description": "Automatically create & optimize responsive image transforms, using either native Craft transforms or a service like Imgix, with zero template changes.",
0 commit comments