Skip to content

Releases: torchbox/wagtail-grapple

v0.14 - StreamField callables

25 Mar 17:22
Compare
Choose a tag to compare

This release adds the much missed ability to use custom StreamField blocks callables or properties that is used aplenty with Page models.

class TextWithCallableBlock(blocks.StructBlock):
    text = blocks.CharBlock()

    graphql_fields = [
        GraphQLString("text"),
        GraphQLString("label"),
        GraphQLField("my_custom_field", source="get_custom_field"),
    ]

    @property
    def label(self):
        return "my block property"
    
    def get_custom_field(self, *args, **kwargs):
        return "welcome, callable source in StreamField"

This feature was developed by @kbayliss.

v0.13 - Wagtail 2.16 and a number of fixes

25 Feb 17:35
Compare
Choose a tag to compare

This release adds Wagtail 2.16 support, and drops Wagtail < 2.14 support.

What's Changed

New Contributors

Full Changelog: v0.12.0...v0.13.0

v0.12.0 - Ch-ch-channels

08 Nov 23:30
Compare
Choose a tag to compare

This release brings a plethora of new features and fixes! 👯

Highlights

  • Wagtail 2.15 support
  • Channels support with Django 3.x

Single settings

As of this version, wagtail-grapple moves from multiple GRAPPLE_ prefixed settings to a single GRAPPLE settings:

# settings.py

GRAPPLE = {
    "APPS": [],  # add your apps to the schema. e.g. ["home", "images", "documents"]
    "AUTO_CAMELCASE": True,
    "ADD_SEARCH_HIT": False,
    "EXPOSE_GRAPHIQL": False,
    "ALLOWED_IMAGE_FILTERS": [],  # e.g. ["width-1000", "fill-300x150|jpegquality-60", "width-700|format-webp"]
    "PAGE_SIZE": 10,
    "MAX_PAGE_SIZE": 100,
}

Changelog

Fixed

  • Fix: custom document model not working with Wagtail grapple (#153). Thanks @ fabienheureux
  • Fix/empty list in structblock (#165). Thanks @bbliem
  • Use absolute URL for renditions (#181). Thanks @fabienheureux
  • Fix channels versions solving issues introduced by Wagtail 2.14 support (#184). Thanks @fabienheureux
  • Use correct endpoint url for GraphiQL when the API endpoint is on a subpath [#194]. Thanks @ruisaraiva19

Added

Misc

v0.11.0 - Renditions, limited

09 Mar 22:03
Compare
Choose a tag to compare

This release:

  • 🤖 Got deployed to PyPi automatically through the power of GitHub Actions! Yes to automation 🎉
  • 📜 Changed the license from MIT to BSD 3, for better alignment with Wagtail
  • 🚀 Introduced a new settings -GRAPPLE_ALLOWED_IMAGE_FILTERS - which accepts a list of filters (thus renditions) that are allowed to generate. Read more about generating renditions in Wagtail docs

An example:

# settings.py

GRAPPLE_ALLOWED_IMAGE_FILTERS = [
    "width-1000",
    "fill-300x150|jpegquality-60",
    "width-700|format-webp"
]

Many thanks to @thibaudcolas for the 🦅👀 observation!

v0.10.2

18 Feb 17:54
Compare
Choose a tag to compare

Allow running alongside Wagtail 2.12

And a small fix for 0.10.1 (Tweak exclusion lists for pages #148)

v0.10.0 - The "Happy Holidays" release

23 Dec 17:26
Compare
Choose a tag to compare

The end of year is almost upon us, so here is one final release 🌲 🎉 🎆

A few little things to celebrate:

  • Query page via url path (#52). Thanks @NathHorrigan
  • Fix filtering by content type in page/pages queries (#147). Thanks @isolationism for another PR that finally propted that fix
  • Fix "excluding custom field" warning with graphene-django>=2.8.1 (#146). Less noise is good, right?

Filter by url path

Grapple supported filtering by slug from the very beginning, however it is not uncommon to have multuple pages with the same slug. The slug is unique only on the tree level the page is added to. e.g.

about/
├─ people
special-index/
├─ a-few-levels/
│  ├─ deep/
│  │  ├─ people

Trying to query for the people slug

{
    page(slug: "people") {
        id
    }
}

would not return any result since there are multiple possibilities. With the new urlPath filter one can get the result they need:

{
    page(urlPath: "/about/people/") {
        id
    }
}

Note: multi-site setups are partially supported. If you have two or more pages with the same url path (say, /about/people) that live under different site roots, then only the first one will be returned. A way around it is to query with inSite: true from the relevant domain which will help narrow the query down

Correct horse staple, er, media and singural query field

08 Dec 19:07
Compare
Choose a tag to compare

This is a bugfix release

  • Fix: use correct media type in GraphQLMedia #142
  • Fix @register_singular_query_field usage with non-Wagtail page models did not return any results

Custom wagtailmedia models too

12 Nov 15:55
Compare
Choose a tag to compare

This is a small bug fix to correctly support custom Media models

Small, but specific

06 Nov 11:54
Compare
Choose a tag to compare

PageChooserBlocks now return specific page instances

Collection queries

04 Nov 16:23
Compare
Choose a tag to compare

We now support Collection queries!
Note, these are Wagtail collections for image and document organisation, rather than the GraphQLCollection field type.

New features

Fixes

  • Fix StubModel already registered RuntimeWarning (#133). @zerolab
  • Add .live().public() to all relevant methods (#129). Thanks @mmmente
  • Various tidy ups