Closed lypanov closed 8 years ago
Hi! Not sure how much help I can be, but try the following for getting the hello-world running:
-> In the hello-world folder, run "npm install rxjs@5.0.0-beta.6" This should get rid of "npm WARN @angular/core@2.0.0-rc.1 requires a peer of rxjs@5.0.0-beta.6 but none was installed" -> You need meteor, you can install it manually from meteor.com/install
-> After this, try running "meteor run" in the hello-world folder
After my third try here is the process I used : (all happen in the terminal/console)
1- copie and paste: git clone https://github.com/apollostack/angular2-apollo.git 2- go to your angular2-apollo folder and do : npm install 3- go to angular2-apollo/examples/hello-world and do : npm install rxjs@5.0.0-beta.6 4- do : meteor (it will automatically put the right release (1.3.1) for the project) ...and it should work !
to stop your app running do : ctrl c to re-run your app do : meteor (in the angular2-apollo/examples/hello-world folder)
info: meteor include node so when you wrote "meteor" you launch in background node
I tried the above steps by @nebiljabari and got the following errors. The website showed the list, but adding did not work.
$ meteor
[[[[[ ~/opt/bkinsey808/angular2-apollo/examples/hello-world ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Meteor 1.3.2.4 is available. Update this project with 'meteor update'.
Compiling main app HTML file: client/index.html
Compiling HTML template: client/main.html
client/main.ts (26, 3): Module '"graphql"' has no exported member 'graphQLResult'.
client/main.ts (97, 10): Property 'addUser' does not exist on type 'Main'.
client/main.ts (98, 14): Parameter 'graphQLResult' implicitly has an 'any' type.
I20160604-06:28:24.414(-10)? [HPM] Proxy created: /graphql -> http://localhost:4000
I20160604-06:28:24.422(-10)? GraphQL Server is now running on http://localhost:4000
=> Started your app.
=> App running at: http://localhost:3000/
Same here (of course) I actually try to solve it. I've make a tour in the graphql.js file but found no export GraphQLResult ... to be continued
Okay, i think i figured out the issue with graphQLResult. I capitalized the G on the import statement so it would import the interface called GraphQLResult (from the typings file, not graphql itself). Then I fixed the implicit any issue by adding : GraphQLResult
to that parameter, so it was typed with that interface instead of any
. Still have not solved the addUser issue yet.
Well done @bkinsey808 ! Concerning the input it print in the console ;-)
In my PR, I fixed the addUser compile issue. Here's what I learned. There is a class decorator that dynamically adds a method. https://github.com/apollostack/angular2-apollo/blob/master/src/apolloDecorator.ts#L98
Typescript does not know how to type this, and there is an issue here: https://github.com/Microsoft/TypeScript/issues/4881 where it is recommended to do "interface merging" which is what I did to get rid of the compile error. There are no more compile errors with this PR however, the new user that is added still does not show up in the list, even though a response comes back from the server and looks good as far as I can tell.
@bkinsey808 The mutation is not include in the query - in schema.js:
schema {
query: Query
mutation: Mutation
}
If you just want to display your in and output :
@lypanov I think we can close this one
Yup, working thanks to @nebiljabari
I'm a angular2 beginner but Apollo looks exceptionally interesting and I'm really hoping to use it together with the excellent work you guys are doing.
Alas.. I just can't seem to get started. Error after error after error! I'm blocked by https://github.com/apollostack/apollo-client/issues/207 in getting the main client working and with angular2-apollo hello-world project I just get more different errors.
(npm WARN @angular/core@2.0.0-rc.1 requires a peer of rxjs@5.0.0-beta.6 but none was installed., followed by sh: meteor: command not found, not sure how that is related to angular2+apollo)
I feel like I'm in a parallel universe in which I forgot how to computer.
Please help! Apollo looks like exactly what my company needs!