Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Latest commit

 

History

History
84 lines (64 loc) · 2.01 KB

contentful.md

File metadata and controls

84 lines (64 loc) · 2.01 KB

Contentful

Sign up for a free Contentful account with GitHub.

image

Add gem "contentful" to Gemfile.

image

image

image

image

image

image

image

image

image

image

require 'dotenv/load'

client = Contentful::Client.new(
  space: ENV["CONTENTFUL_SPACE_ID"],
  access_token: ENV["CONTENTFUL_ACCESS_TOKEN"],
  dynamic_entries: :auto
)
contentful_bootstrap create_space andrewmcodes --template blog

Install cloudinary and graphql playground

query {
  accountCollection {
    items {
      sys {
        id
        publishedAt
        firstPublishedAt
        publishedVersion
      }
      title
      url
      username
      image {
        title
        url
      }
    }
  }
}

query {
  pageCollection {
    items {
      title
      description
      content
      sys {
        id
        publishedAt
        publishedVersion
        firstPublishedAt
      }
    }
  }
}