Orchard Harvest 2024 Program, expose Content Fields Indexing via GraphQL for content field filtering - This week in Orchard (26/07/2024)

Fix Liquid script tag does not render custom attributes, and exposing Content Fields Indexing via GraphQL for content field filtering are the topics for this week. The full program of the Orchard Harvest conference, with all the speaker and talk details, is out! Without further ado, let's dive in!

Orchard Core updates

Fix Liquid script tag does not render custom attributes

The following Liquid template line

{% script name:"pdf.js", src:"/Vendor/pdfjs/build/pdf.js", type:"module", defer:"defer", at:"head", depends_on:"jQuery" %}

renders in <head> as:

<script src="/t4h/OrchardCore.Resources/Scripts/jquery.min.js"></script>
<script src="/Vendor/pdfjs/build/pdf.js"></script>

As you can see, the defer and type attributes are missing. The issue was a missing clause in the ScriptTag.cs file.

Fix Liquid script tag does not render custom attributes

Expose Content Fields Indexing via GraphQL for content field filtering

If you want to filter (with where) the value of content fields, you must implement a WhereInputObjectGraphType for it. There's no built-in way to filter content field values from GraphQL.

We already have Content Fields Indexing to be able to run SQL queries for field values. The goal of this change is to build on that and expose such SQL indices in GraphQL too.

The GraphQL module now allows for filtering content fields, making it easier to query specific content fields using GraphQL. This enhancement relies on having the OrchardCore.ContentFields.Indexing.SQL module enabled.

Additionally, the GetAliases method in the IIndexAliasProvider interface is now asynchronous and has been renamed to GetAliasesAsync. Implementations of this interface should be modified by updating the method signature and ensuring they handle asynchronous operations correctly.

To see this in action, we need to enable the mentioned Content Fields Indexing (SQL) module under Configuration -> Features. We also enabled the GraphQL feature to have the GraphiQL option under the Configuration menu for easier testing.

The following example demonstrates filtering Product content types based on a numeric content field named Amount, which is attached to a content part named Price Part, where the Amount is greater than 10. Note that in our example the Price Part is collapsed with the prevent field name collision option enabled. You can set these if you edit the content part settings of the attached Price Part.

Expose content fields indexing via GraphQL for content field filtering

As you can see, we have two products where the value of the Amount numeric field is greater than 10.

News from the community

Orchard Harvest 2024 Program

The full Orchard Harvest program has finally arrived. This year’s program is packed with insightful sessions, engaging panels, and ample opportunities to connect with the Orchard community and to make Orchard Harvest the biggest Orchard Core event of the year. All sessions will be recorded and published on the Orchard YouTube channel after the event, so even if you can't make it live, you can see the sessions. However, being there live will allow you to ask the speakers, meet other community members, and have a lot of fun!

All indicated times are local time in Las Vegas. After each session, you'll have a chance to ask questions, and we'll have a short break too. Here is a detailed schedule to help you prepare for the conference.

Orchard Harvest 2024 Program

Can't wait until September? Check out recordings from last year's special online Orchard Harvest on this YouTube channel here.

Ready to be a part of something extraordinary? Reserve your spot today and take advantage of early-bird pricing at Orchard Harvest Conference 2024. Secure your spot today and get ready to level up your skills at Orchard Harvest Conference 2024! See you there!

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 467 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course.

Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here!

If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting! The recordings of the latest meetings will be uploaded in the first half of August, stay tuned for videos!