porkloin / drupal-8-gatsby

A step-by-step repo for my intro to Drupal 8/Gatsby.js tutorial
MIT License
2 stars 1 forks source link

Example breaks with latest JSON:API Extras #1

Open benjifisher opened 6 years ago

benjifisher commented 6 years ago

Following your tutorial, I simplified a little:

composer require -o drupal/jsonapi_extras
...
  - Installing justinrainbow/json-schema (5.2.7): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing e0ipso/shaper (1.2.2): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/jsonapi (1.23.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/jsonapi_extras (2.11.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
...

I got these errors when I tried to restart Gatsby:

gatsby develop
...
⠂ source and transform nodesStarting to fetch data from Drupal
⠈ source and transform nodesFailed to fetch http://drupalviews.lndo.site/jsonapi/language_content_settings/language_content_settings Request failed with status code 500
undefined
error Plugin gatsby-source-drupal returned an error

  Error: Request failed with status code 500
...

Switching to my Drupal site (d is an alias for lando drush):

d ws 156
 ID         :  156                                                                                                                                                                                                                              
 Date       :  25/Nov 13:51                                                                                                                                                                                                                     
 Type       :  php                                                                                                                                                                                                                              
 Severity   :  error                                                                                                                                                                                                                            
 Message    :  Error: Call to a member function get() on null in Drupal\jsonapi_extras\ResourceType\ConfigurableResourceType->includeCount() (line 118 of /app/modules/contrib/jsonapi_extras/src/ResourceType/ConfigurableResourceType.php)

(stack trace omitted).

It seems to be related to this bug: Update to 2.11 no work.

I downgraded jsonapi_extra:

composer require -o drupal/jsonapi_extras:2.10.0
benjifisher commented 6 years ago

Do we really need JSON:API Extras? The current version does not seem to work with the 8.x-2.x version of JSON API, and I do not want to be stuck on the 8.x-1.x branch.