Skip to content

Commit

Permalink
chore: update GraphCMS references (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozguruysal authored Jul 14, 2022
1 parent f4166fd commit 97c2638
Show file tree
Hide file tree
Showing 19 changed files with 317 additions and 102 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ node_modules
# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
.vercel
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# gatsby-starter-graphcms-blog
# gatsby-starter-hygraph-blog

> A [Gatsby](httsp://gatsbyjs.com) starter for creating a basic blog with [GraphCMS](https://graphcms.com)
> A [Gatsby](httsp://gatsbyjs.com) starter for creating a basic blog with [Hygraph](https://hygraph.com)
[Demo](https://gatsby-starter-graphcms-blog.vercel.app)[`gatsby-source-graphcms`](https://github.com/GraphCMS/gatsby-source-graphcms)
[Demo](blog.withheadlesscms.com)[`gatsby-source-hygraph`](https://github.com/Hygraph/gatsby-source-hygraph)

[![Clone project](https://graphcms.com/button)](https://app.graphcms.com/clone/a1cd264ab6d3448d9b4d1e2cc2162620?name=Blog)
[![Clone project](https://hygraph.com/button)](https://app.graphcms.com/clone/a1cd264ab6d3448d9b4d1e2cc2162620?name=Blog)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FGraphCMS%2Fgatsby-starter-graphcms-blog&env=GRAPHCMS_ENDPOINT,GRAPHCMS_TOKEN&envDescription=GraphCMS%20API%20Endpoint%20and%20Token&envLink=https%3A%2F%2Fgithub.com%2FGraphCMS%2Fgatsby-starter-graphcms-blog%23quick-start&project-name=graphcms-blog&repo-name=graphcms-blog&demo-title=GraphCMS%20Blog&demo-description=Gatsby%20starter%20for%20creating%20a%20basic%20blog%20with%20GraphCMS&demo-url=https%3A%2F%2Fblog.withheadlesscms.com%2F&demo-image=https%3A%2F%2Frepository-images.githubusercontent.com%2F283171327%2F1dc64780-e3de-11ea-9661-8f89688dc13c)

## Quick start

1. **Create a new Gatsby project via the [Gatsby CLI](https://www.npmjs.com/package/gatsby-cli)**

```shell
gatsby new graphcms-blog https://github.com/GraphCMS/gatsby-starter-graphcms-blog
gatsby new hygraph-blog https://github.com/Hygraph/gatsby-starter-hygraph-blog
```

2. **Provide your GraphCMS project keys**
2. **Provide your Hygraph project keys**

> In order to use this starter, you'll need to have created a new GraphCMS project using our `Blog Template`.
> In order to use this starter, you'll need to have created a new Hygraph project using our `Blog Template`.
Navigate into your new site’s directory and copy the `.env.sample` file.

```shell
cd graphcms-blog
cd hygraph-blog
cp .env.sample .env
```

Inside of your newly created `.env` file, provide values for each variable. These variables can be found in the [project settings UI](https://graphcms.com/docs/guides/concepts/apis#working-with-apis).
Inside of your newly created `.env` file, provide values for each variable. These variables can be found in the [project settings UI](https://hygraph.com/docs/guides/concepts/apis#working-with-apis).

```env
GRAPHCMS_ENDPOINT=""
GRAPHCMS_TOKEN=""
HYGRAPH_ENDPOINT=""
HYGRAPH_TOKEN=""
```

3. **Start building!**
Expand All @@ -44,6 +44,6 @@ yarn dev

## Features

- Use [`gatsby-image`](https://www.gatsbyjs.org/packages/gatsby-image) with your GraphCMS image assets.
- MDX support via [`gatsby-plugin-mdx`](https://www.gatsbyjs.org/packages/gatsby-plugin-mdx) on GraphCMS `RichText` fields.
- Use [`gatsby-image`](https://www.gatsbyjs.org/packages/gatsby-image) with your Hygraph image assets.
- MDX support via [`gatsby-plugin-mdx`](https://www.gatsbyjs.org/packages/gatsby-plugin-mdx) on Hygraph `RichText` fields.
- Built with [Tailwind CSS](https://tailwindcss.com/).
7 changes: 4 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ require('dotenv').config()

module.exports = {
siteMetadata: {
title: 'GraphCMS Blog',
title: 'Hygraph Blog',
description:
'Gatsby blog starter for GraphCMS! Powered by `gatsby-source-graphcms`, featuring `gatsby-image` and MDX!',
keywords: 'Headless CMS, GraphCMS, GraphQL CMS, Gatsby',
'Gatsby blog starter for Hygraph! Powered by `gatsby-source-hygraph`, featuring `gatsby-image` and MDX!',
keywords: 'Headless CMS, Hygraph, GraphQL CMS, Gatsby',
},
plugins: [
'gatsby-plugin-mdx',
Expand All @@ -27,6 +27,7 @@ module.exports = {
token: process.env.GRAPHCMS_TOKEN,
buildMarkdownNodes: true,
downloadLocalImages: true,
fragmentsPath: 'hygraph-fragments',
},
},
'gatsby-transformer-sharp',
Expand Down
23 changes: 0 additions & 23 deletions graphcms-fragments/Author.graphql

This file was deleted.

24 changes: 0 additions & 24 deletions graphcms-fragments/Page.graphql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ fragment Asset on Asset {
width
size
mimeType
createdBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
updatedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
publishedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
coverImagePost {
... on Post {
remoteTypeName: __typename
Expand All @@ -29,5 +47,11 @@ fragment Asset on Asset {
remoteId: id
}
}
scheduledIn {
... on ScheduledOperation {
remoteTypeName: __typename
remoteId: id
}
}
url
}
47 changes: 47 additions & 0 deletions hygraph-fragments/Author.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
fragment Author on Author {
stage
remoteId: id
createdAt
updatedAt
publishedAt
name
title
biography
createdBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
updatedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
publishedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
picture {
... on Asset {
remoteTypeName: __typename
remoteId: id
locale
}
}
posts {
... on Post {
remoteTypeName: __typename
remoteId: id
}
}
scheduledIn {
... on ScheduledOperation {
remoteTypeName: __typename
remoteId: id
}
}
}
48 changes: 48 additions & 0 deletions hygraph-fragments/Page.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
fragment Page on Page {
stage
remoteId: id
createdAt
updatedAt
publishedAt
title
slug
subtitle
content {
... on RichText {
raw
html
markdown
text
}
}
createdBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
updatedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
publishedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
scheduledIn {
... on ScheduledOperation {
remoteTypeName: __typename
remoteId: id
}
}
seo {
... on Seo {
remoteTypeName: __typename
remoteId: id
}
}
}
38 changes: 31 additions & 7 deletions graphcms-fragments/Post.graphql → hygraph-fragments/Post.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ fragment Post on Post {
slug
date
excerpt
coverImage {
... on Asset {
remoteTypeName: __typename
remoteId: id
locale
}
}
content {
... on RichText {
raw
Expand All @@ -24,12 +17,43 @@ fragment Post on Post {
}
}
tags
createdBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
updatedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
publishedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
coverImage {
... on Asset {
remoteTypeName: __typename
remoteId: id
locale
}
}
author {
... on Author {
remoteTypeName: __typename
remoteId: id
}
}
scheduledIn {
... on ScheduledOperation {
remoteTypeName: __typename
remoteId: id
}
}
seo {
... on Seo {
remoteTypeName: __typename
Expand Down
58 changes: 58 additions & 0 deletions hygraph-fragments/ScheduledOperation.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
fragment ScheduledOperation on ScheduledOperation {
stage
remoteId: id
createdAt
updatedAt
publishedAt
description
errorMessage
rawPayload
createdBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
updatedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
publishedBy {
... on User {
remoteTypeName: __typename
remoteId: id
}
}
release {
... on ScheduledRelease {
remoteTypeName: __typename
remoteId: id
}
}
status
affectedDocuments {
... on Asset {
remoteTypeName: __typename
remoteId: id
locale
}
... on Author {
remoteTypeName: __typename
remoteId: id
}
... on Page {
remoteTypeName: __typename
remoteId: id
}
... on Post {
remoteTypeName: __typename
remoteId: id
}
... on Seo {
remoteTypeName: __typename
remoteId: id
}
}
}
Loading

1 comment on commit 97c2638

@vercel
Copy link

@vercel vercel bot commented on 97c2638 Jul 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.