Hey, this is rather uncannonical PR with various changes. Its this way because I was fixing various things as I was trying to use the plugin. I dont expect the PR to be merged right away but submitting anyway :) Maybe will be of some use to someone.
Changes made:
recursive use of types cause stack overflow error in touchType method (TypedDocumentParser.scala). This is probably least controversial change and can be cherrypicked right away.
I added json encoders to all the types generated. Its not an optimal solution as encoders are only needed for types included in Variables but it was easier to add it everywhere. Relates to #35
I modified the sbt part in a way that allows to use the codegen in both Compile and Test configuration. From user perspective the change shouldnt be visible as the default graphqlCodegen defaults to compile:graphqlCodegen but now test:graphqlCodegen has also a meanigful implementation that takes queries from test sources and produces output to test results. The only problem I have hit is that Interfaces files clashes (you have 2 of those, one for prd and one for test). It wasnt an issue for my particular case because I need it only in tests.
Hey, this is rather uncannonical PR with various changes. Its this way because I was fixing various things as I was trying to use the plugin. I dont expect the PR to be merged right away but submitting anyway :) Maybe will be of some use to someone.
Changes made:
touchType
method (TypedDocumentParser.scala
). This is probably least controversial change and can be cherrypicked right away.Variables
but it was easier to add it everywhere. Relates to #35Compile
andTest
configuration. From user perspective the change shouldnt be visible as the defaultgraphqlCodegen
defaults tocompile:graphqlCodegen
but nowtest:graphqlCodegen
has also a meanigful implementation that takes queries from test sources and produces output to test results. The only problem I have hit is thatInterfaces
files clashes (you have 2 of those, one for prd and one for test). It wasnt an issue for my particular case because I need it only in tests.