Closed (fixed)
Project:
GraphQL Compose
Version:
2.3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
19 Jul 2024 at 00:24 UTC
Updated:
12 Feb 2025 at 10:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
roaguicr commentedComment #4
roaguicr commentedThe MR includes a submodule that extends the Link schema to add LinkAttributes on it, it should work with the default attributes included in the link_attributes module.
Comment #5
anicotoI applied the patch and tested on a web site and is working.
Drupal Version 10.2.6
PHP 8.2.21
Comment #6
anicotoComment #7
jmolivas commented+1 on this submodule
Comment #8
almunningsHappy to bring this into main module rather than a sub module.
Comment #9
almunningsAlso looks like changes have been made on the 2.2.x branch and not on the issue branch. I'll do some force pushes to move this around.
Comment #12
cedricl commentedWe also did something like this but with support for custom attributes. Instead of just only adding the default attributes from the module. We created the custom attributes 'style' and 'type'. But this can be everyting since we loop over the definitions from the \Drupal\link_attributes\LinkAttributesManager
Comment #13
mcortes19 commented+1
Comment #15
almunningsHeyya
I've combined the feedback.
Are you able to test PR 97 please.
If all good I'll write some tests for the various link mod modules.
Comment #16
almunningsComment #17
theodorosploumisI found an issue with this feature which may be related to the main module.
When I enable the new module graphql_compose_linkattributes it seems that I cannot override later the Link class with another custom module. Only when I disable the the module graphql_compose_linkattributes I can override it.
How to reproduce this? Enable the graphql_compose_linkattributes module from this patch and then create another module that has similar functionality to this. When you enable it the new fields are not attached to the LinkType (although the new GraphQL type is available on Docs).
We may need to investigate here, also, if methods hook_graphql_compose_graphql_type_alter() and hook_graphql_compose_field_type_alter() allows for multiple and correct inheritance.
Comment #18
almunningsOn PR 95 or 97?
I’m working with 97
Comment #19
theodorosploumisI was working with the patch from 95.
Comment #20
almunningsGrab 97 please. 95 I’m not gonna merge. If same issues happy to move fwd on your feedback
Comment #21
theodorosploumisI have no issues with the PR number 97. Thanks!
Comment #22
apmsooner commentedI don't have menu_link_attributes module enabled but do have link_attributes. Problem i'm having is the schema type in LinkAttributesType.php is set to nonNull. So my graphql queries fail on menus with this. Setting it to getNullableType fixes it for me.
Comment #23
apmsooner commentedWorks great with my commit to allow null.
Comment #25
almunningsPretty-much ready to commit this, I just want to create a test for the comment in 8eaabeaf, just has me being a bit cautious here.
Comment #27
almunningsMerged pending 2.3 release
Comment #28
almunnings