Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live reload on .graphql files #115

Open
peterpetre opened this issue Feb 27, 2018 · 6 comments
Open

Live reload on .graphql files #115

peterpetre opened this issue Feb 27, 2018 · 6 comments

Comments

@peterpetre
Copy link

Is it possible right now to config file extensions to watch and reload? for graphql files i m using graphql-import.

@migueloller
Copy link

Perhaps in addition to passing node args, we could also pass nodemon args here and use -e js,graphql as documented here.

Thoughts @jaredpalmer?

@ctrlplusb
Copy link

ctrlplusb commented Apr 18, 2018

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
  },
}

@mxstbr
Copy link
Collaborator

mxstbr commented Nov 8, 2018

I'd love to have this!

@5achinJani
Copy link

@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 :|

@ryands17
Copy link

ryands17 commented Mar 5, 2019

@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
  },
}

@5achinJani
Copy link

Thanks @ryands17 that works like charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants