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

Migration codegen to apollo (documentation and examples) #575

Closed
un33k opened this issue Sep 3, 2018 · 6 comments
Closed

Migration codegen to apollo (documentation and examples) #575

un33k opened this issue Sep 3, 2018 · 6 comments

Comments

@un33k
Copy link

un33k commented Sep 3, 2018

[ x ] docs

It would be great to have a before and after examples for helping to migrate from codegen to apollo cli.

The current readme is very inadequate at this moment.

@JakeDawkins
Copy link
Contributor

I'm going to close this issue.

Most of codegen's commands have been aliased even if deprecated, and there have been dramatic docs and changelog updates since this issue was created. If there are any specific recommendations, or if someone wants to champion this, I can reopen or handle that appropriately once proposed.

@geonanorch
Copy link

geonanorch commented Apr 3, 2019

Hi @JakeDawkins. I would like to second @un33k 's request:

I just got the npm warning The 'apollo-codegen' command has been replaced with the more-powerful 'apollo' CLI....
I checked the provided link https://npm.im/apollo#code-generation, but initially it did not look helpful (later I realized that codegen is described, but much earlier in the page).
Then I googled for "migrating from apollo-codegen". The first 3 entries are github issues, the 4th is the Apollo documentation, which is still on apollo-codegen stand ! On that first Google page there is also no other obvious entry about that topic (we could of course argue about what 'obvious' means)

So based on this (obviously biased) experience I would say that @un33k had a point about some guiding documentation being required --probably changing the #code-generation anchor in the NPM-provided link to point to the relevant location.

UPDATE:
the first entry in Google is a github issue about the same error message I just got trying to migrate... Looks like the migration is not all that straightforward, all the more reason for a bit of documentation.

@JakeDawkins
Copy link
Contributor

@geonanorch The readme from the link you provided is almost completely auto-generated, so there's not much we can do to update the anchor to point to an earlier point on the page.

The issue with giving before -> after examples in code is that codegen supports such a wide array of use cases, and covering even a few would be challenging. The API for much of codegen should be relatively similar to commands used in the recent past, but if you're coming from a much older version of codegen, there may not be as easy of a migration path as simply changing commands and arguments (as you mentioned).

At some point it may be more useful to just setup the codegen again from scratch rather than chasing migration paths. If you have specific questions, I'd love to take a look. You can ask them in the apollo-tooling channel of the [spectrum(https://spectrum.chat/apollo) channel.

Really sorry I can't be more helpful here

@geonanorch
Copy link

@JakeDawkins thank you for answering.

Basically we are saying "there is no guidance for migration" and you are saying "take the pain". Fair enough.

That the anchors for documentation cannot be changed easily, I can understand too --the doc tree looks like a maze to me, no idea how it is built.

Still it seems to me that at least the current documentation stand should refer to the new tooling, not to the old apollo-codegen ? That way we have at least a working example and starting point directly in the docs.

@JakeDawkins
Copy link
Contributor

Ohh, I wasn't aware that was still there 🙈

Thanks for the heads up @geonanorch!

@IanVS
Copy link

IanVS commented Jan 22, 2020

It's still referencing apollo-codegen, FWIW. (angular, react)

And if anyone has found a guide on how to generate the same kinds of type names as apollo-codegen did, it would probably be great to post here. I'm finding that simply translating cli options from the old to the new tool is not sufficient, as the type names being generated are quite different. I was really hoping there'd be some kind of basic guide available.

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

5 participants