- Issue created by @mcortes19
- ๐ง๐ชBelgium cedricl
We did this, but made it hardcoded only for the fields we needed, you can take a look in our module for inspiration.
- ๐จ๐ทCosta Rica mcortes19
Thanks @CedricL, I'll definitely use it as inspiration and hopefully as a basis for contributing.
- First commit to issue fork.
- ๐ฆ๐บAustralia almunnings Melbourne, ๐ฆ๐บ
Howdy, MR is in, please test and let me know.
Because we don't "out of the box" support a union of MenuItem types, I've added it to an `extras` field.Then I messed about with some of the form UX to make it less.. crap to work with.
Enable the MenuLinkContent entity fields on Menu in the GraphQL Compose schema form.
Query on the
MenuItem.extras
union.{ menu(name: MAIN) { items { extras { ... on MenuLinkContentMain { kitties } } } } }
Also added on
MenuItem.langcode
โLanguage
- Status changed to Needs review
9 months ago 5:38am 16 February 2024 - ๐จ๐ทCosta Rica mcortes19
I tested on the D10.8 site and it returned the following error:
For error #0: Error: Call to protected method Drupal\menu_link_content\Plugin\Menu\MenuLinkContent::getEntity() from scope Drupal\graphql_compose_menus\Plugin\GraphQL\DataProducer\MenuTreeLinkEntity in Drupal\graphql_compose_menus\Plugin\GraphQL\DataProducer\MenuTreeLinkEntity->resolve() (line 45 of /app/web/modules/contrib/graphql_compose/modules/graphql_compose_menus/src/Plugin/GraphQL/DataProducer/MenuTreeLinkEntity.php)
Seems like the `getEntity()` method is public until D10.2 โ and many sites are not ready to move to D10.2
- Status changed to Needs work
9 months ago 10:07am 23 February 2024 - Status changed to Needs review
9 months ago 7:11am 28 February 2024 - ๐ฆ๐บAustralia almunnings Melbourne, ๐ฆ๐บ
Ok,
So thats updated now to use a buffer again.Wondering if the semantics are now correct.
isextras
ok?
should it befields
Or do we completely mess with the menu system and clean it up to make more sense if this is an actual entity now.
Keen for feedback, as i dont feel like going...
menu(name: MAIN) { items { extras { thing } } }
Really means anything to anyone. It feels like a total after thought. Theres gotta be an "if i didn't have to support any legacy stuff, this is the ideal structure" moment, somewhere?
Have a plan
Keen on feedback - Status changed to Needs work
8 months ago 9:42pm 23 March 2024 - ๐ฆ๐บAustralia almunnings Melbourne, ๐ฆ๐บ
Without trying to over think this more, I feel like โfieldsโ makes the most sense here.
Will write up some tests tonight and get this in.
- Status changed to Fixed
8 months ago 12:49am 30 March 2024 -
almunnings โ
committed c22d5abc on 2.1.x
Resolve #3415306 "Support menu item"
-
almunnings โ
committed c22d5abc on 2.1.x
- Status changed to Fixed
7 months ago 11:11pm 11 April 2024