question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack’ing GraphQL Documents

See original GitHub issue

In 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:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dfreemancommented, May 9, 2017

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…)

1reaction
dfreemancommented, May 9, 2017

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 ES6 imports 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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found