Webpack’ing GraphQL Documents
See original GitHub issueIn order to Webpack the GraphQL Documents inside our apps, is there any step that could be done in ember-apollo-client
? Or should all configuration be placed into each app config? Could we provide a how-to into the Wiki?
/cc @dfreeman
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Webpack'ing your GraphQL Documents
When building a GraphQL application, there are benefits that come from placing your GraphQL query documents in their own files rather than ...
Read more >Load your graphql documents with webpack (Apollo) - Medium
This makes easy to store your GraphQL documents in a different “repository” than your view components, share fragments across the documents and ...
Read more >Getting started with React & GraphQL part I
Universal building - both browser + Node.js web server compile down to static files, for fast server re-spawning. Per-request GraphQL store.
Read more >How do I import this graphql schema from a .graphql file?
graphql file. I tried this but it doesn't seem to be working for me: New: import .graphql files in Meteor!
Read more >GQL: A Package for Working with GraphQL Documents - Morioh
gql: A package for working with GraphQL documents. This package exports several libraries: package:gql2/language.dart provides ability to parse GraphQL ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The Webpack loader itself does very little — it’s basically just some glue between Webpack and
graphql-tag
, plus a bit of handling for#import
lines.We can easily do the same thing in Broccoli without introducing the overhead of the extra Webpack bundling step. (Incidentally, the tests on that branch appear to pass…)
I think the Ember-conventional approach would be to skip Webpack entirely and register a preprocessor with the CLI that does something similar.
With that approach I think we could pretty easily get the
#import
directives working by translating them to ES6import
s and then letting the built-in bundler handle the rest. It should even Just Work with importing things from addons, which would be nice if you had a something like a shared core schema.I’ll see if I can build out a proof of concept sometime in the next few days or over the weekend to verify this would actually work 😃