Problem/Motivation
ComposeConfig::config() declares a nullable return type (?ImmutableConfig). It returns null when ComposeContext::getServerId() cannot resolve the server —
which happens in any CLI/Drush context because there is no active HTTP route to extract the graphql_server parameter from.
Steps to reproduce
- Have
graphql_composewithgraphql_exportenabled - Run
drush graphql-export:schemaordrush config:export - Observe the fatal error
Proposed resolution
Add a guard clause at the top of registerResolvers():
$settings = ComposeConfig::config();
if (!$settings) {
return;
}
Issue fork graphql_compose-3592505
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
cedricl commentedActually this won't fix the entire problem. Real issue is here: https://www.drupal.org/project/graphql_compose/issues/3592509