Problem/Motivation
After updating from 2.1.0-beta1 to 2.1.0-beta4, when i tried to access my endpoint or use the explorer i got the following warning.
Warning: Undefined array key "extensions" in Drupal\graphql\Plugin\GraphQL\Schema\ComposableSchema->getExtensions() (line 34 of /app/cms/web/modules/contrib/graphql/src/Plugin/GraphQL/Schema/ComposableSchema.php)
And following error
TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 34 of /app/cms/web/modules/contrib/graphql/src/Plugin/GraphQL/Schema/ComposableSchema.php).
Might be related to https://github.com/drupal-graphql/graphql/issues/1395.
Issue fork graphql_compose-3441242
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:
- 3441242-undefined-array-key
changes, plain diff MR !72
Comments
Comment #2
abhishek_gupta1 commentedComment #4
abhishek_gupta1 commented@CedricL, I have fixed the issue and created MR. please review it once
Comment #5
almunningsNot sure thats it, `getDefinitions` should always return an array.
I feel we have a bigger issue with merging non graphql_compose schemas into the final result.Hmm.
I booted up a little external schema using the graphql SdlSchemaExtensionPluginBase, and it worked.
@cedric do you have any custom SchemaExtension plugins?
What base classes are you extending?
Comment #6
almunningsOk, it probably boils down to...
$this->getConfiguration()['extensions']I'll take a look deeper there tonight after everyone goes to bed :)
There was some schema changes upstream in GraphQL which I had to try work with.
Can you try going to the GraphQL schema in the GraphQL admin interface, and just clicking "save" ?
Eg URL:
/admin/config/graphql/servers/manage/YOUR-CORE-IDComment #7
almunningsIf I put in a sneaky little
dump($this->getConfiguration());inweb/modules/contrib/graphql/src/Plugin/GraphQL/Schema/ComposableSchema.phpin the methodgetExtensionsI get the following:
What do you get? (Plugin IDs might vary between dev and beta4)
And I guess like the obvious one, did you try clear cache?
Comment #8
almunningsLooks like its the schema changes.
Should be
I'll create an update function to check for graphql compose schemas and update that.
Comment #11
almunnings@CedricL Please pull dev at hash, or apply patch
https://git.drupalcode.org/project/graphql_compose/-/commit/3377d6294360...
Let me know if that is fixed after running
drush updatedbor the database updates via the Drupal UI.Thanks!
(For anyone else, just re-saving the server config page should fix this)
Comment #12
cedricl commentedThe patch file fixed the issue. Thanks for the fast responses.
Comment #13
almunningsSweet. The update will rerun next release due to a number change, but glad that’s the issue found.
Will push up b5 now.
Comment #14
almunningsTagged and released
Thanks all
Comment #15
almunnings