Graphql-code-generator: Document differences with Apollo Codegen

Created on 28 Jun 2017  路  4Comments  路  Source: dotansimha/graphql-code-generator

I'm using this project because at the time of adoption apollo-codegen did not support the gql tag. Now that it does I'm not so sure what the difference between this project and Apollo's version is.

Could it be documented? (I'd make a PR, but I can't because I don't know...)

And thank you for an awesome library, it's been one of the huge advantages of using graphql :)

Most helpful comment

Also, apollo-codegen is focused more around queries. This project generates useful code for schemas as well which helps to provide types for your resolvers. Super, super useful.

All 4 comments

@altschuler
Basically, apollo-codegen generates a similar results, but it based on code that generates the results.
This package uses Templates (with Handlebars) to generate results, and it basically supports any output because you can simply create you template and then compile it with your GraphQL schema and get a more customized result.
It also offers a single command to generate your code from your schema.

This package intents to be more generic and offer it's users to customize the results and create custom generated code from their schema and operations.
At the moment, apollo-codegen aims to generate typescript, flow and swift only.

Thank you! That clears things up. This might be a good addition to the readme.

Also, apollo-codegen is focused more around queries. This project generates useful code for schemas as well which helps to provide types for your resolvers. Super, super useful.

Added to README :) Thanks @altschuler @zephraph !

Was this page helpful?
0 / 5 - 0 ratings