2

I successfully worked through the Angular2 tutorial. Now I want to replace the HTTP server from the last step with an Apollo-GraphQL server (http://docs.apollostack.com/apollo-client/angular2.html).

I added the Apollo-dependencies to my package.json:

"angular2-apollo": "0.1.0",
"apollo-client": "0.3.12",
"graphql": "^0.5.0",
"graphql-tools": "^0.3.8",

In my main.js I am bootstrapping the Apollo providers:

import { APOLLO_PROVIDERS } from 'angular2-apollo';
...
bootstrap(AppComponent, [ APOLLO_PROVIDERS ]);

Unfortunately, this gives me a 404 when I start the server:

16.06.03 11:55:47 404 GET /angular2-apollo/index.js

I adapted the SystemJS-config like this:

var map = {
  ...
    'angular2-apollo':            'node_modules/angular2-apollo/src',
  ...
};
var packages = {
  ...
    'angular2-apollo':            { main: 'index.js', defaultExtension: 'js' },
  ...
};

This worked for the angular2-apollo module. But now every other imported module inside the angular2-apollo module gets a 404. Of course I could go through the whole dependency tree and add every module to SystemJS (in fact I did this until a depth of ~3). But this is clearly not how it is supposed to work?

Is there a convenient way to get Angular2 working with the Apollo Integration?

debergalis
  • 11,870
  • 2
  • 49
  • 43
  • ok I'm on it now. can you save me time and share your code? the code of the tutorial on Github is not updated to the latest Angular RC – Urigo Jun 08 '16 at 19:22
  • I encountered the problem, re-installed the node modules and cleared the browser cache and it worked. @PeterSchroederAEB can you please try that? (without changing anything in the SystemJS config) – Urigo Jun 08 '16 at 22:05
  • 1
    @Urigo That did not work for me. But I completed the SystemJS.config now and it works. See https://github.com/apollostack/angular2-apollo/issues/23 – PeterSchroederAEB Jul 14 '16 at 07:50

0 Answers0