Closed almunnings closed 2 months ago
Ahoy hoy
If you have a schema without any extensions, and you use the AlterSchemaExtensionDataEvent to add to $extensions, the $ast will always return NULL.
AlterSchemaExtensionDataEvent
$extensions
$ast
NULL
https://github.com/drupal-graphql/graphql/blob/8.x-4.x/src/Plugin/GraphQL/Schema/AlterableComposableSchema.php#L172
$ast = !empty($extensions) ? Parser::parse(implode("\n\n", $event->getSchemaExtensionData()), ['noLocation' => TRUE]) : NULL;
Should probably read:
$extensions = $event->getSchemaExtensionData(); $ast = !empty($extensions) ? Parser::parse(implode("\n\n", $extensions), ['noLocation' => TRUE]) : NULL;
Ran into this with GraphQL Compose. The sdl extensions are injected via the event, not via schema extensions.
Please and thank you.
Ahoy hoy
If you have a schema without any extensions, and you use the
AlterSchemaExtensionDataEvent
to add to$extensions
, the$ast
will always returnNULL
.https://github.com/drupal-graphql/graphql/blob/8.x-4.x/src/Plugin/GraphQL/Schema/AlterableComposableSchema.php#L172
Should probably read:
Ran into this with GraphQL Compose. The sdl extensions are injected via the event, not via schema extensions.
Please and thank you.