Releases: torchbox/wagtail-grapple
v0.14 - StreamField callables
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
This release adds Wagtail 2.16 support, and drops Wagtail < 2.14 support.
What's Changed
- hostName -> hostname by @KalobTaulien in #215
- Modify setup.py so package can be detected by GitHub by @thibaudcolas in #216
- Support for Wagtail 2.16 by @fabienheureux in #212
- Support for queryset slicing when using
searchQuery
by @protasovse in #206 - Remove deprecated use of
ugettext_lazy
by @13hakta in #202
New Contributors
- @KalobTaulien made their first contribution in #215
Full Changelog: v0.12.0...v0.13.0
v0.12.0 - Ch-ch-channels
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
- Add contentType filter on site pages query (#171). Thanks @sks
- Add hooks for registering mutation and subscription mixins (#155). Thanks @ruisaraiva19
- Add single
GRAPPLE
setting (#175)). Thanks @ruisaraiva19 - Add middleware support for queries (#177). Thanks @ruisaraiva19
- Add support for Wagtail v2.14 (#172). Thanks @fabienheureux
- Add support for Wagtail v2.15 (#197). Thanks @ruisaraiva19
- Add missing fields to images and documents (#195). Thanks @ruisaraiva19
Misc
- Use the Wagtail Sphinx theme for docs (#183). Thanks @fabienheureux
- Middleware docs updates
- Use
blacken-docs
(#187)
v0.11.0 - Renditions, limited
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
v0.10.0 - The "Happy Holidays" release
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
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
This is a small bug fix to correctly support custom Media models
Small, but specific
PageChooserBlock
s now return specific page instances
Collection queries
We now support Collection queries!
Note, these are Wagtail collections for image and document organisation, rather than the GraphQLCollection
field type.
New features
- Support Wagtail 2.11. Further testing welcome!
- Add collections types (#111). Thanks @fabienheureux
- Add hook for registering query mixins (#132). See documentation. @zerolab
- Add webpquality support for renditions (#130). Thanks @ruisaraiva19