gatsby-source-ghost
Advanced tools
Comparing version 3.0.0 to 3.1.0
const GhostContentAPI = require('@tryghost/content-api'); | ||
const Promise = require('bluebird'); | ||
const {PostNode, PageNode, TagNode, AuthorNode} = require('./nodes'); | ||
const {PostNode, PageNode, TagNode, AuthorNode, SettingsNode} = require('./nodes'); | ||
@@ -46,3 +46,5 @@ exports.sourceNodes = ({boundActionCreators}, configOptions) => { | ||
return Promise.all([fetchPosts, fetchPages, fetchTags, fetchAuthors]); | ||
const fetchSettings = api.settings.browse().then(setting => createNode(SettingsNode(setting))); | ||
return Promise.all([fetchPosts, fetchPages, fetchTags, fetchAuthors, fetchSettings]); | ||
}; |
@@ -13,2 +13,3 @@ const createNodeHelpers = require('gatsby-node-helpers').default; | ||
const AUTHOR = 'Author'; | ||
const SETTINGS = 'Settings'; | ||
@@ -19,1 +20,2 @@ module.exports.PostNode = createNodeFactory(POST); | ||
module.exports.AuthorNode = createNodeFactory(AUTHOR); | ||
module.exports.SettingsNode = createNodeFactory(SETTINGS); |
{ | ||
"name": "gatsby-source-ghost", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Gatsby source plugin for building websites using the Ghost API as a data source.", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:TryGhost/gatsby-plugin-ghost.git", |
@@ -76,3 +76,3 @@ # Gatsby Source Ghost | ||
{ | ||
allGhostPost(filter: {tags: {elemMatch {slug: {eq: $slug}}}}) { | ||
allGhostPost(filter: {tags: {elemMatch: {slug: {eq: $slug}}}}) { | ||
edges { | ||
@@ -79,0 +79,0 @@ node { |
@@ -36,2 +36,9 @@ // Switch these lines once there are useful utils | ||
]); | ||
const browseSettings = sinon.stub().resolves( | ||
{ | ||
title: 'Ghost & Gatsby', | ||
description: 'Thoughts, stories and ideas.', | ||
navigation: [{label: 'Home', url: '/'}] | ||
} | ||
); | ||
const GhostContentApiStub = function () { | ||
@@ -42,3 +49,4 @@ return { | ||
tags: {browse: browseTags}, | ||
authors: {browse: browseAuthors} | ||
authors: {browse: browseAuthors}, | ||
settings: {browse: browseSettings} | ||
}; | ||
@@ -52,3 +60,3 @@ }; | ||
.then(() => { | ||
createNode.callCount.should.eql(6); | ||
createNode.callCount.should.eql(7); | ||
@@ -64,2 +72,3 @@ const getArg = call => createNode.getCall(call).args[0]; | ||
getArg(5).internal.should.have.property('type', 'GhostAuthor'); | ||
getArg(6).internal.should.have.property('type', 'GhostSettings'); | ||
@@ -66,0 +75,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11043
163
0