fullstack-tutorial icon indicating copy to clipboard operation
fullstack-tutorial copied to clipboard

Wrong order of the actions performed in the tutorial

Open wojciech-bilicki-oke opened this issue 6 years ago • 10 comments

i believe in https://www.apollographql.com/docs/tutorial/production.html you are showing the wrong order of actions needed to properly deploy the apollo service to the engine.

To set up a service we need to provide endpoint. I assume this endpoint should be coming from Zeit Now. Yet deployment of the service to Now is described further down the road. Wouldn't it make more sense to describe it first and then go to deploying the service to the engine?

wojciech-bilicki-oke avatar Nov 19 '18 11:11 wojciech-bilicki-oke

Ok my bad, you don't need Zeit account to follow through tutorial. But this makes me think, why is tutorial mentioning deployoment to the serverless at all? We send queries from client to localhost in the next section, so what's the point?

wojciech-bilicki-oke avatar Nov 19 '18 12:11 wojciech-bilicki-oke

I'm having an issue with the Check and publish with the Apollo CLI step. Receiving a Error: No service found to link to Engine. Anyone have ideas?

arthur-zhuk avatar Nov 21 '18 17:11 arthur-zhuk

I'm having an issue with the Check and publish with the Apollo CLI step. Receiving a Error: No service found to link to Engine. Anyone have ideas?

I have the same issue, there is a same issue here: [https://github.com/apollographql/apollo/issues/239]

yuwenhuang avatar Nov 21 '18 17:11 yuwenhuang

I just had the same issue, and then stupidly realized I hadn't copied in the whole key. I only added the hash at the end to the ENGINE_API_KEY value in the .env file.

So, don't make the stupid mistake I did please. The .env file entry should look like this:

ENGINE_API_KEY=service:<service-name>:<hash-made-by-apollo-engine>

The push to Apollo Engine worked perfectly after that.

Actually, I've also made an addition to the docs too. The description is wrong.

Scott

smolinari avatar Dec 16 '18 17:12 smolinari

I still think this issue is valid.

I'm confused by the whole Apollo Engine thing ... do I need two different services w/i Engine, one for development and one for production? Presumably so, since you'd want to differentiate usage across those use cases. But it's also questionable to me why you'd want your local dev stuff in Engine at all.

The tutorial is mismatched; it says to "deploy to Now", but then says push the schema engine using localhost:4000.

It's really confusing.

jeffreywescott avatar Dec 24 '18 00:12 jeffreywescott

Yeah, @jeffreywescott. I was mixing two issues into this one.

I agree. The whole bit about adding the schema to Engine and uploading/ publishing the API to zeit.co is misplaced. They are both useful, but for the tutorial, they might be better off at the end, as neither are really necessary.

Scott

smolinari avatar Dec 24 '18 13:12 smolinari

@smolinari really?

But the Engine example explicitly suggests using localhost:4000 for the endpoint. So ... is Engine not needed for development? Can I tell code running locally to bypass it somehow?

jeffreywescott avatar Dec 25 '18 22:12 jeffreywescott

@jeffreywescott - Nope. You don't need Engine to develop a GraphQL system at all. It's a supplementary set of services, which help you with development of a GraphQL system, but it most definitely isn't necessary.

Scott

smolinari avatar Dec 26 '18 05:12 smolinari

Thanks. I wish the engine docs made more sense. The truth is that the whole "development vs. production" thing makes it really confusing. For example, it is only production servers that send data to engine? If so, how does the server know? NODE_ENV? If not, how does data from development not "clutter up" the "real" data that engine is meant to be tracking?

Engine seems cool. And I'd like to try it, but until it's better documented, I think I'll just avoid it. I'd recommend removing it from the tutorial, as well, or at least explaining things better. Bonus points if the aforementioned engine docs also get updated.

jeffreywescott avatar Dec 26 '18 07:12 jeffreywescott

Update: these other docs show how to turn on engine in a server. TL;DR -- if the ENGINE_API_KEY isn't set, and you don't explicitly pass an apiKey when initializing the server, Engine metrics won't be sent.

jeffreywescott avatar Dec 26 '18 07:12 jeffreywescott