Created
November 28, 2018 21:47
-
-
Save EyMaddis/d14a77193d60b859fce09e6d2c7a8c8b to your computer and use it in GitHub Desktop.
Postgraphile nested in Nuxt.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
serverMiddleware: [ | |
'~/postgraphileServerMiddleware' | |
] | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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