graphql-engine/community/sample-apps/gatsby-postgres-graphql/gatsby-config.js
2019-01-17 15:57:28 +05:30

22 lines
504 B
JavaScript

const fetch = require(`node-fetch`)
const { createHttpLink } = require(`apollo-link-http`)
module.exports = {
plugins: [
{
resolve: 'gatsby-source-graphql',
options: {
typeName: 'HASURA',
fieldName: 'hasura',
createLink: () =>
createHttpLink({
uri: `${ process.env.HASURA_GRAPHQL_URL }`,
headers: {},
fetch,
}),
refetchInterval: 10, // Refresh every 60 seconds for new data
},
},
]
};