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

Problems with hello-world / getting started in general #21

Closed
lypanov opened this issue Jun 3, 2016 · 9 comments
Closed

Problems with hello-world / getting started in general #21

lypanov opened this issue Jun 3, 2016 · 9 comments

Comments

@lypanov
Copy link

lypanov commented Jun 3, 2016

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 apollographql/apollo-client#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!

@pso-aeb
Copy link

pso-aeb commented Jun 3, 2016

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

@nebiljabari
Copy link

nebiljabari commented Jun 3, 2016

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

@bkinsey808
Copy link
Contributor

bkinsey808 commented Jun 4, 2016

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/     

@nebiljabari
Copy link

nebiljabari commented Jun 4, 2016

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

@bkinsey808
Copy link
Contributor

bkinsey808 commented Jun 4, 2016

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.

@nebiljabari
Copy link

Well done @bkinsey808 ! Concerning the input it print in the console ;-)

@bkinsey808
Copy link
Contributor

bkinsey808 commented Jun 5, 2016

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: microsoft/TypeScript#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.

@nebiljabari
Copy link

nebiljabari commented Jun 10, 2016

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

@lypanov I think we can close this one

@lypanov
Copy link
Author

lypanov commented Jun 13, 2016

Yup, working thanks to @nebiljabari

@lypanov lypanov closed this as completed Jun 13, 2016
jbaxleyiii pushed a commit that referenced this issue Oct 18, 2017
Add details about notifyOnNetworkStatusChange and returnPartialData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants