linkit icon indicating copy to clipboard operation
linkit copied to clipboard

Is there a way to eager-load linked entries?

Open proimage opened this issue 5 years ago • 8 comments

I notice there's a DB query for each Linkit field pointing to an entry (understandably, to fetch entry title and whatnot). Is there a way to eager-load this stuff? Thanks!

proimage avatar Mar 07 '19 20:03 proimage

@proimage did you ever get any resolution on this? I'm looping through entries to build the header and footer navigation which results in dozens of additional queries per page load.

Caching helps of course but it still seems like a no brainer to eager-load these for my use case.

chrislkeefer avatar Aug 15 '19 21:08 chrislkeefer

Nope; at this point I'd tend to just use an Entries fieldtype to link to other entries for a nav, instead of using LinkIt.

proimage avatar Aug 16 '19 18:08 proimage

Any news on this? Would love to see this as well

jan-dh avatar Sep 18 '19 08:09 jan-dh

I'm also interested if that possible :)

davidhellmann avatar Dec 09 '19 07:12 davidhellmann

+1! I'd love to see eager loading on this field as it would massively decrease database queries for things like footers.

Is there an obvious pattern that other fields have implemented in order to support eager loading?

nickdunn avatar May 15 '21 22:05 nickdunn

¯_(ツ)_/¯

davidhellmann avatar Nov 17 '21 11:11 davidhellmann

¯_(ツ)_/¯

(try triple backslashes, eg ¯\\\_(ツ)_/¯: ¯\_(ツ)_/¯ )

proimage avatar Nov 17 '21 15:11 proimage

So, we have added support for eager loading in the upcoming release 1.2, current dev branch on the craft 3 repo (this is the c2 version) see: https://github.com/presseddigital/linkit/issues/89

We are still testing before release, if you want to provide feedback, please do grab the latest version from the develop branch, defo test / local versions only as not production ready. Also note the package name change, from fruitstudios to presseddigital

samhibberd avatar Nov 17 '21 15:11 samhibberd