Module to source data from drupal API.
First - getDrupal() frunction is used to pull all data.
Then - data() function is used to create nodes in gatsby internal source system with createNode native method.
Parameters:
| Name | Type | Description |
|---|---|---|
actions |
Object | Object that holds gatsby method for managing nodes. |
createNode |
function | Function from the actions object, used to create nodes. Gatsby Doc : createNode |
createContentDigest |
function | Function to create hash for caching purpose. |
configOptions |
Object | Object with the configurations declared in gatsby-config.js file at the root of the project. |
Methods
(inner) data(data)
After pulling all the data and mapping data into the desired shape,
createNode is used to create the data node in Gatsby File system via gatsby-source-filesystem plugin
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | The data of the node pulled from drupal |
(async, inner) getDrupal() → {Array.<Array>}
Function that loop and pull from every endpoints.
Returns:
- returns an array of promises that when resolved will holds datas from all sources
- Type
- Array.<Array>