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
232 stars 26 forks source link

Support question: what are resources? #75

Open arnoldbird opened 6 years ago

arnoldbird commented 6 years ago

The concept of resources is unclear to me in the README. I think most likely resources are not actual resources (in the sense of data from nodes or other entities) but rather are more like a schema that describes the available resources. If so, I don't understand why the client needs to declare the resources, or fetch a list of resources and then include that when fetching data. This part of the API makes no sense to me, as I don't know why the client needs to tell the server what resources the server offers.

richgerdes commented 6 years ago

Resources are a definition of the API endpoints. This can either be retrieved automatically from the OpenApi module, or by supplying the config as a json object and passing it as config. If the parameter is left off, then its expected that the configuration will come from the openapi resource in the Drupal installation.