backpack
backpack copied to clipboard
Live reload on .graphql files
Is it possible right now to config file extensions to watch and reload? for graphql files i m using graphql-import.
Perhaps in addition to passing node args, we could also pass nodemon args here and use -e js,graphql
as documented here.
Thoughts @jaredpalmer?
I had luck using the graphql-import-loader and the below backpack config:
module.exports = {
webpack: (config, options, webpack) => {
config.module.rules.push({
exclude: /node_modules/,
test: /\.graphql$/,
use: [{ loader: 'graphql-import-loader' }],
})
return config
},
}
I'd love to have this!
@ctrlplusb 's solution works but it requires me to make changes in js file ( index.js ) to get the updates in the playground and also I've to manually refresh the playground so yeah "live-reload" doesn't work :|
@5achinJani you can add this in the backpack.config.js
file as a workaround
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin')
module.exports = {
webpack: (config, options, webpack) => {
config.plugins.push(
new ExtraWatchWebpackPlugin({
files: ['<path-to-graphql-files>'],
})
)
return config
},
}
Thanks @ryands17 that works like charm.