Skip to content

v0.21.0 - a pinch of SVGs in a sea of consistency

Compare
Choose a tag to compare
@zerolab zerolab released this 04 Sep 16:21
· 42 commits to main since this release
c5913c9

This release adds better handling of SVG images.

It also introduced a couple of potentially breaking changes: passes the GraphQLResolveInfo object to StreamField callables, and uses consistent ID type for page queries. See below

What's Changed

  • Uniform ID Type for pages and page Queries by @estyxx in #350

    [!WARNING]
    if your query looked like

    query($id: Int) { 
        page(id: $id) { ... }
    }

    it need to change to

    query($id: ID) { 
        page(id: $id) { ... } 
    }
  • Pass the GraphQLResolveInfo object to the StreamField callables by @zerolab in #356

    [!WARNING]
    This is a breaking change and requires existing resolver signatures to be updated.

    # before
    def get_field(self, value=None):
       ...
    #  - or - 
    def get_field(self, *, value=None):
       ...
    
    # after
    def get_field(self, info, value=None):
       ...
    
    # - or -
    def get_field(self, *, info, value=None):
       ...
    
    # or, type-hinted
    from graphql import GraphQLResolveInfo
    
    
    def get_field(self, info: GraphQLResolveInfo, value: dict[str, Any] | None):
        ...
  • Switch to using tox by @zerolab in #360
    We now test with a wider combination of Django + Wagtail

  • Add coverage report by @zerolab in #362

  • Add SVG support by @zerolab in #359
    You can differentiate images using the isSVG property. The image rendition field accepts a preserveSvg argument which will help prevent raster image operations (e.g. format-webp, bgcolor, etc.) being applied to SVGs. Reference

    [!NOTE]
    The image rendition query will now surface any errors when:

    • using filters not present in the ALLOWED_IMAGE_FILTERS Grapple setting,
    • there are no filters to apply (for example you are requesting an SVG rendition but supply raster image operations)
    • the source image is not present

    Previously we would silently absorb them, returning null/None for the rendition.

New Contributors

Full Changelog: v0.20.0...v0.21.0