acquia / waterwheel.js

A generic JavaScript helper library to query and manipulate Drupal 8 via core REST and JSON API
https://github.com/acquia/waterwheel.js
233 stars 26 forks source link

Support question: waterwheel.js in combination with Reservoir? #78

Open Xilver opened 6 years ago

Xilver commented 6 years ago

I'm a frontend developer who's been working on an internal R&D project to see how we can have a decoupled Drupal installation and a React frontend. I was thinking that Waterwheel and Reservoir would work well together, but that doesn't seem to be the case. I assume Waterwheel expects newer module versions (more specifically simple_oauth) than what Reservoir currently offers in its alpha state.

At least that's what I would gather from the error I'm getting when using jsonapi.get: Fatal error: Class Drupal\simple_oauth\Authentication\TokenAuthUser contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods. Updating simple_oauth to the latest version doesn't seem to be supported on the current Reservoir version either.

Are there any plans in the future to bring the two closer together? As a non-backend developer, both Reservoir and Waterwheel seemed like great choices to keep my current API-first Javascript workflow going. Or should I go for a full-fledged Drupal 8 installation and implement RESTful APIs that way?

Xilver commented 6 years ago

Update: A full Drupal 8 installation with an updated simple_oath module doesn't seem to do the trick, I'm getting loads of other errors now. Not using OAuth at all (validation: false in config.js) does work however, and that way I can use Reservoir.

NickDaelemans commented 6 years ago

I'm having the same issues. It looks like Reservoir is depending on the simple_oauth module 2.0-rc2 which doesn't support bearer tokens, which is what waterwheel uses. Upgrading to 8.x-3.8 could be a possible solution. But since reservoir is depending on the 2.0-rc2 version, this solution doesn't seem to work.

Another solution would be to use another type of tokens inside of waterwheel.js