Skip to content

GitNation/graphql-content-layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

49dfb8d · Sep 10, 2024
Feb 11, 2021
Apr 3, 2020
Nov 20, 2020
Sep 10, 2024
Jun 6, 2022
Nov 20, 2020
Jan 15, 2020
Nov 20, 2020
Dec 26, 2019
Dec 27, 2019
Dec 26, 2019
Dec 26, 2019
Apr 11, 2020
Dec 27, 2019
Dec 27, 2019
Sep 10, 2024
Apr 7, 2023
Feb 21, 2023

Repository files navigation

npm version

GitNation GraphQL Content Layer

package for fetching conference content from GraphCMS

it's published on NPM as

@focus-reactive/graphql-content-layer

This package is intended for:

  1. Fetching data from GraphCMS, process and building content layer
  2. Generate Storybook with output of:
    1. GraphCMS queries (CMS Layer)
    2. Processed content (Content Layer)

API and Configuring

  1. GraphCMS connection should be configured via env variables: CMS_ENDPOINT and CMS_TOKEN

  2. The package exposes getContent async function for generating content layer

Usage:

const { getContent } = require('@focus-reactive/graphql-content-layer');

const content = await getContent(conferenceSettings);

see conferenceSettings for details

  1. The package generates Storybook with CMS and Content layers

to use it:

// story.js

const {
  passConferenceSettings,
} = require('@focus-reactive/graphql-content-layer/dist/content.stories');

passConferenceSettings(conferenceSettings);

conferenceSettings

Pass conferenceSettings with conference specific ("hardcoded") data

I should contain:

tagColors - colors settings for "tech" badges, tags, labels

speakerAvatar = {
 dimensions: {
   avatarWidth: 500,
   avatarHeight: 500,
 }
}
  • image transformation settings for speakers/trainers/mcs and so on avatars

Develop

yarn dev to start watching and compiling the code

yarn storybook to launch Storybook

yarn tdd - Jest tests in watching mode

yarn start - starts dev, storybook and tests (each in independent watch mode)

yarn update-schema for updating GraphQL introspection schema

For publishing to NPM:

npm publish

it will transpile the code and publish the package

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published