From a83d21b7bf28d5cf7ac5a16692755439e70561aa Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Sat, 11 Apr 2020 17:03:59 +0300 Subject: [PATCH] v 2.1.3 --- README.md | 3 ++- package.json | 25 +++++++++++++++++++++++-- src/fetch-diversity.js | 3 +++ src/index.js | 1 + tests/jsnation.conference-settings.js | 5 +++++ 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dbc2a8f..8c03127 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# GitNation GraphQL Content Layer [![npm version](https://badge.fury.io/js/%40focus-reactive%2Fgraphql-content-layer.svg)](https://badge.fury.io/js/%40focus-reactive%2Fgraphql-content-layer) +[![npm version](https://badge.fury.io/js/%40focus-reactive%2Fgraphql-content-layer.svg)](https://badge.fury.io/js/%40focus-reactive%2Fgraphql-content-layer) +# GitNation GraphQL Content Layer package for fetching conference content from GraphCMS diff --git a/package.json b/package.json index 9aac663..75b68ab 100755 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "storybook": "start-storybook -p 6001 --ci", "update-schema": "graphql get-schema", "test": "jest", - "test:smoke": "jest tests/smoke.test.js", + "test:smoke": "jest tests/smoke.test.js --detectOpenHandles", "tdd": "jest --watch", "prepare": "package-prepare", "prestart": "relative-deps", @@ -69,5 +69,26 @@ "relativeDependencies": { "@focus-reactive/storybook-addon-graphcms": "../../Addons/storybook-graphql-kit-graphcms/" }, - "license": "MIT" + "homepage": "https://github.com/GitNation/graphql-content-layer", + "bugs": { + "url": "https://github.com/GitNation/graphql-content-layer/issues" + }, + "author": "Oleg Proskurin (https://github.com/focusreactive)", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/GitNation/graphql-content-layer.git" + }, + "keywords": [ + "graphql", + "graphcms", + "query", + "queries", + "search", + "storybookjs", + "content", + "content-layer", + "gitnation", + "conference" + ] } diff --git a/src/fetch-diversity.js b/src/fetch-diversity.js index 50ac0f1..ce9e9e0 100644 --- a/src/fetch-diversity.js +++ b/src/fetch-diversity.js @@ -39,6 +39,9 @@ const fetchData = async (client, { tagColors, ...vars }) => { const data = await client .request(queryPages, vars) .then(res => res.conf.year[0].diversity); + if (!data) { + return {}; + } let { maxTickets, sponsoredTickets } = data; diff --git a/src/index.js b/src/index.js index 24f3dcf..798a040 100644 --- a/src/index.js +++ b/src/index.js @@ -83,6 +83,7 @@ const getContent = async conferenceSettings => { piece[k] = { ...content[k], ...piece[k] }; }); } catch (err) { + console.log('content, piece', piece); console.error(err); } return { ...content, ...piece }; diff --git a/tests/jsnation.conference-settings.js b/tests/jsnation.conference-settings.js index d32e2e4..b70ee1c 100644 --- a/tests/jsnation.conference-settings.js +++ b/tests/jsnation.conference-settings.js @@ -1,3 +1,6 @@ +const conferenceTitle = 'React_Summit_Online'; +const eventYear = 'Y2020'; + const tagColors = { NodeJS: { tagBG: '#7AB464', @@ -45,6 +48,8 @@ const speakerAvatar = { }; module.exports = { + conferenceTitle, + eventYear, tagColors, speakerAvatar, };