Skip to content

Instantly share code, notes, and snippets.

@EyMaddis
Created November 28, 2018 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EyMaddis/d14a77193d60b859fce09e6d2c7a8c8b to your computer and use it in GitHub Desktop.
Save EyMaddis/d14a77193d60b859fce09e6d2c7a8c8b to your computer and use it in GitHub Desktop.
Postgraphile nested in Nuxt.js
module.exports = {
serverMiddleware: [
'~/postgraphileServerMiddleware'
]
...
}
const { postgraphile } = require('postgraphile')
module.exports = postgraphile(process.env.DATABASE_URL, 'public', {
watchPg: true, // automatic reload when database changes
graphiql: true, // for dev
graphqlRoute: '/api/graphql', // optional to avoid conflicts with nuxt.js default routing
graphiqlRoute: '/api/graphiql'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment