DEV Community

loading...

Apollo server or client?

kurisutofu profile image kurisutofu ・1 min read

I need to create a set of web tools for the company I started.
Since it's my company, I'm the one to decide on the technology to use and since it's a side-business for the moment, I'm not in a hurry to choose (within limits off course).

It's been a while since I've programmed in anything else than .net and C# or basic javascript with jQuery (anyone remembers this? :D) but I had the chance once to play with Node.js with PhoneGap and that made me want to try Node.js more.

I also recently tried Graphql and I loved it so now I want to use it.

After reading a lot of different things about Node.js and Graphql and all the solutions around them, I've come to the conclusion I wanted to create a solution combining Graphql + Apollo Server on the server side and Apollo Client + Vue.js on the client side.

I see the server side as an API and maybe even later use it with mobile devices application but that's for later.

Graph

As a test, I could create a quick API with graphql and Apollo Server but now that I need to create the client side, I'm a little lost on how to implement this.

I'm wondering ... Do I really need both version of Apollo?
I like having the flexibility of an API but would you recommend to go simply with Apollo Client + Vue.js + Graphql?

Also, in my current plan, would I lose the benefit of Apollo Client if I don't use it directly with Graphql?

Discussion (4)

pic
Editor guide
Collapse
jasman7799 profile image
Jarod Smith

So graphql is a new way to API designed by Facebook. Apollo implimented Facebook's spec in javascript to make it easy to use. They built Apollo server to implement the actual API and Apollo client to interface with a graphql server not just Apollo's server but any graphql server. I've used them both and they work well. To answer your question though no you don't have to use either Apollo tool, I think Facebook has their own implementation in node but it requires far more setup on your end. I would recommend you go forward with your current plan, and yes you would lose the benefit of the Apollo client if you don't use graphql server side.

Collapse
bartweb profile image
bartweb

Instead of vuex you can use also cache from Apollo :)

Collapse
kurisutofu profile image
kurisutofu Author

What do you mean by that?
Do you mean about the state management?

I'm not going to use vuex only (or at all?) but probably vue-apollo which is based on vue CLI 3.

So caching in apollo could be useful but does not tell me if I really need apollo server ...

Collapse
bartweb profile image
bartweb

Yes I mean as a state management.
In our project we don’t using Apollo server but we have php backend.