coder fire
coder fire

Reputation: 1063

How I can use graphql with angular 1.5?

I have standart factories in my angular app for rest api. I need to configure my angular app for api with GraphQl. How i can do this? I now about angular2-apollo but I have angular 1.5.

Upvotes: 7

Views: 7836

Answers (3)

JimTheDev
JimTheDev

Reputation: 3469

Here is a live example. Basically the biggest part is how to set up the client in the config, from there you can just use it like any other service.

https://codesandbox.io/s/l4r87nqj5z

Edit: this actually uses the library in Kamil's answer.

Upvotes: 0

Kamil Kisiela
Kamil Kisiela

Reputation: 509

You can use angular1-apollo package.

http://github.com/apollostack/angular1-apollo

Upvotes: 11

Urigo
Urigo

Reputation: 3185

Yes you can use Apollo-Client and just wrap the functions with $q.

Here is an example (Look at the Angular1App folder): https://github.com/robzhu/graphql-demo

Upvotes: 8

Related Questions