Gridsome Source for Cosmic JS
Source plugin for fetching data into Gridsome from Cosmic JS. Cosmic JS offers a Headless CMS for your Gridsome website.
Install
npm install --save gridsome-source-cosmicjs
How to use
// In your gridsome.config.jsplugins: use: 'gridsome-source-cosmicjs' options: bucketSlug: 'gridsome-blog-cosmicjs' objectTypes: `posts` // If you have enabled read_key to fetch data (optional). apiAccess: read_key: ''
How to query and filter
You can query the nodes created from Cosmic JS with the following:
query IndexQuery posts: allCosmicjsPosts edges node id slug title
and you can filter specific node using this:
query { post: { id content title }}