mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-11-11 05:10:51 +03:00
update gatsby-postgres-graphql boilerplate (#551)
This commit is contained in:
parent
e82eb52305
commit
0ebe82c598
@ -60,3 +60,5 @@ typings/
|
||||
.cache/
|
||||
public
|
||||
yarn-error.log
|
||||
|
||||
package-lock.json
|
||||
|
@ -1,6 +1,6 @@
|
||||
# gatsby-postgres-graphql
|
||||
|
||||
Boilerplate to get started with Gatsby, Hasura GraphQL engine as CMS and postgres as database using the awesome plugin [wyze/gatsby-source-graphql](https://github.com/wyze/gatsby-source-graphql).
|
||||
Boilerplate to get started with Gatsby, Hasura GraphQL engine as CMS and postgres as database using the awesome plugin [gatsby-source-graphql](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-graphql).
|
||||
|
||||
# Running the app yourself
|
||||
|
||||
|
@ -1,18 +1,20 @@
|
||||
const fetch = require(`node-fetch`)
|
||||
const { createHttpLink } = require(`apollo-link-http`)
|
||||
|
||||
module.exports = {
|
||||
// ...
|
||||
plugins: [
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
resolve: 'gatsby-source-graphql',
|
||||
options: {
|
||||
name: 'queries',
|
||||
path: `${__dirname}/src/queries/`,
|
||||
},
|
||||
},
|
||||
{
|
||||
resolve: '@wyze/gatsby-source-graphql',
|
||||
options: {
|
||||
headers: {},
|
||||
url: `${ process.env.HASURA_GRAPHQL_URL }`,
|
||||
typeName: 'HASURA',
|
||||
fieldName: 'hasura',
|
||||
createLink: () =>
|
||||
createHttpLink({
|
||||
uri: `${ process.env.HASURA_GRAPHQL_URL }`,
|
||||
headers: {},
|
||||
fetch,
|
||||
}),
|
||||
refetchInterval: 10, // Refresh every 60 seconds for new data
|
||||
},
|
||||
},
|
||||
]
|
||||
|
12273
community/boilerplates/gatsby-postgres-graphql/package-lock.json
generated
12273
community/boilerplates/gatsby-postgres-graphql/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -8,9 +8,11 @@
|
||||
"serve": "gatsby serve"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wyze/gatsby-source-graphql": "^1.2.0",
|
||||
"gatsby": "^1.9.277",
|
||||
"gatsby-link": "^1.6.46",
|
||||
"gatsby-source-filesystem": "^1.5.39"
|
||||
"apollo-link-http": "^1.5.5",
|
||||
"gatsby": "^2.0.9",
|
||||
"gatsby-link": "^2.0.2",
|
||||
"gatsby-source-graphql": "^2.0.2",
|
||||
"react": "^16.5.2",
|
||||
"react-dom": "^16.5.2"
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import AuthorList from "../components/AuthorList"
|
||||
const Index = ({ data }) => (
|
||||
<div>
|
||||
<h1>My Authors </h1>
|
||||
<AuthorList authors={data.hasuraGraphQl.author} />
|
||||
<AuthorList authors={data.hasura.author} />
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -12,7 +12,7 @@ export default Index;
|
||||
|
||||
export const query = graphql`
|
||||
query AuthorQuery {
|
||||
hasuraGraphQl {
|
||||
hasura {
|
||||
author {
|
||||
id
|
||||
name
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
author {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user