-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* FIX #44 Generate code and decoders for `enum` type This adds the general capability for generating interfaces and types in the ApolloSource generator * Add fragments to generated document * Initial tests for fragment code generation * Additional test for nested fragments * Remove interfaces from concrete queries * scalafmt * Remove types from concrete queries and add test for types generation * Fix circe generation test * Adding json generation for enum types * Scalafmt * Wrap types in object types and import in generated code * Add nested fragment to test project * Add documentation * Add scripted test for duplicated fragment names
- Loading branch information
Showing
44 changed files
with
598 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name := "test" | ||
enablePlugins(GraphQLCodegenPlugin) | ||
scalaVersion := "2.12.4" | ||
|
||
libraryDependencies ++= Seq( | ||
"org.sangria-graphql" %% "sangria" % "1.3.0" | ||
) | ||
|
||
graphqlCodegenStyle := Apollo | ||
|
||
TaskKey[Unit]("check") := { | ||
val generatedFiles = (graphqlCodegen in Compile).value | ||
val interfacesFile = generatedFiles.find(_.getName == "Interfaces.scala") | ||
|
||
assert(interfacesFile.isDefined, s"Could not find generated scala class. Available files\n ${generatedFiles.mkString("\n ")}") | ||
} |
1 change: 1 addition & 0 deletions
1
src/sbt-test/codegen/apollo-duplicate-fragments/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("rocks.muki" % "sbt-graphql" % sys.props("project.version")) |
20 changes: 20 additions & 0 deletions
20
...-test/codegen/apollo-duplicate-fragments/src/main/graphql/HeroNestedFragmentQuery.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
query HeroNestedFragmentQuery { | ||
hero { | ||
...CharacterInfo | ||
} | ||
human(id: "Lea") { | ||
homePlanet | ||
...CharacterInfo | ||
} | ||
} | ||
|
||
fragment CharacterFriends on Character { | ||
name | ||
} | ||
|
||
fragment CharacterInfo on Character { | ||
name | ||
friends { | ||
...CharacterFriends | ||
} | ||
} |
Oops, something went wrong.