Skip to content

Instantly share code, notes, and snippets.

@xuxucode
Last active January 25, 2018 01:42
Show Gist options
  • Save xuxucode/4c8acc1d02a8f471ce66421ba3d1daaa to your computer and use it in GitHub Desktop.
Save xuxucode/4c8acc1d02a8f471ce66421ba3d1daaa to your computer and use it in GitHub Desktop.
Drupal GraphQL 3.x patch
diff --git a/modules/graphql_core/src/Plugin/Deriver/Fields/EntityFieldDeriver.php b/modules/graphql_core/src/Plugin/Deriver/Fields/EntityFieldDeriver.php
index def5716..ea5e931 100644
--- a/modules/graphql_core/src/Plugin/Deriver/Fields/EntityFieldDeriver.php
+++ b/modules/graphql_core/src/Plugin/Deriver/Fields/EntityFieldDeriver.php
@@ -29,6 +29,10 @@ class EntityFieldDeriver extends EntityFieldDeriverWithTypeMapping {
return [];
}
+ if ($fieldDefinition->getType() === 'map') {
+ return [];
+ }
+
$derivative = [
'parents' => $parents,
'name' => EntityField::getId($fieldName),
diff --git a/modules/graphql_core/src/Plugin/Deriver/Types/EntityFieldTypeDeriver.php b/modules/graphql_core/src/Plugin/Deriver/Types/EntityFieldTypeDeriver.php
index 01a80e5..b518cc4 100644
--- a/modules/graphql_core/src/Plugin/Deriver/Types/EntityFieldTypeDeriver.php
+++ b/modules/graphql_core/src/Plugin/Deriver/Types/EntityFieldTypeDeriver.php
@@ -19,6 +19,10 @@ class EntityFieldTypeDeriver extends EntityFieldDeriverBase {
return [];
}
+ if ($fieldDefinition->getType() === 'map') {
+ return [];
+ }
+
$fieldName = $fieldDefinition->getName();
return ["$entityTypeId-$fieldName" => [
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment