Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/t1mmen/gatsby-source-asknicely
Gatsby source plugin for loading responses from AskNicely
https://github.com/t1mmen/gatsby-source-asknicely
Last synced: about 1 month ago
JSON representation
Gatsby source plugin for loading responses from AskNicely
- Host: GitHub
- URL: https://github.com/t1mmen/gatsby-source-asknicely
- Owner: t1mmen
- License: mit
- Created: 2018-03-28T22:26:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-29T18:48:09.000Z (almost 7 years ago)
- Last Synced: 2024-11-14T12:55:07.738Z (3 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-source-asknicely
> Loads testimonials from AskNicely into Gatsby.js## Installation
```bash
npm install gatsby-source-asknicely
```## Usage
To use this source you need to supply an AskNicely API key and your AskNicely subdomain. You can create an API key by logging into AskNicely and going to `Cog > API`. You can see your subdomain by logging into your AskNicely backend and checking the URL, e.g. `mycompany.asknicely.com`.
Next, edit `gatsby-config.js` to use the plugin:
```javascript
{
...
plugins: [
...
{
resolve: 'gatsby-source-asknicely',
options: {
subdomain: 'mycompany',
apiKey: 'abc-123',
// optional
queryParams: {
// See API docs
// NB: camelCased!
}
},
},
]
}
```By default, `gatsby-source-asknicely` will only retrieve testimonials that are published. To change this behavior, you can also supply an optional `queryParams` parameter inside of `options`. Possible query parameters are detailed in [AskNicely's API Documentation](https://timelyapp.asknice.ly/help/responses), **but camelCased**! (ie, `pagesize` = `pageSize`, `since_time` = `sinceTime`)
## Querying
You can query the nodes created by the plugin as follows:
```graphql
{
allAskNicelyTestimonial {
edges {
node {
...
}
}
}
}
```## Thanks
Based on [@tumblbug's](https://github.com/tumblbug) [gatsby-source-workable](https://github.com/tumblbug/gatsby-source-workable)