Skip to content

Commit

Permalink
Use newest feature in the test-project
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 committed Jan 13, 2018
1 parent 23eee45 commit 3adcbae
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 16 deletions.
57 changes: 41 additions & 16 deletions test-project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
name := "graphql-test-project"

enablePlugins(GraphQLSchemaPlugin, GraphQLQueryPlugin)
lazy val root = project.in(file("."))
.aggregate(server, client)

libraryDependencies ++= Seq(
"org.sangria-graphql" %% "sangria" % "1.3.0",
"org.sangria-graphql" %% "sangria-circe" % "1.1.0"
)
lazy val server = project.in(file("server"))
.enablePlugins(GraphQLSchemaPlugin, GraphQLQueryPlugin)
.configs(IntegrationTest)
.settings(commonSettings, Defaults.itSettings)
.settings(
graphqlSchemaSnippet := "example.ProductSchema.schema",
// integration settings
graphqlQueryDirectory in IntegrationTest := (sourceDirectory in IntegrationTest).value / "graphql"
)

graphqlSchemaSnippet := "example.ProductSchema.schema"
lazy val client = project.in(file("client"))
.enablePlugins(GraphQLCodegenPlugin, GraphQLQueryPlugin)
.settings(commonSettings)
.settings(
graphqlCodegenSchema := graphqlRenderSchema.toTask("starwars").value,
resourceDirectories in graphqlCodegen := List(
(sourceDirectory in Compile).value / "graphql"
),
graphqlCodegenPackage := "rocks.muki.graphql",
name in graphqlCodegen := "Api",
// includeFilter in graphqlCodegen := "product.graphql"
)

graphqlSchemas += GraphQLSchema(
"sangria-example",
"staging schema at http://try.sangria-graphql.org/graphql",
Def.task(
GraphQLSchemaLoader
.fromIntrospection("http://try.sangria-graphql.org/graphql", streams.value.log)
.loadSchema()
).taskValue
)
lazy val commonSettings = Seq(
scalaVersion := "2.12.4",
organization := "rocks.muki",
libraryDependencies ++= Seq(
"org.sangria-graphql" %% "sangria" % "1.3.0",
"org.sangria-graphql" %% "sangria-circe" % "1.1.0"
),
// define schemas available in all builds
graphqlSchemas += GraphQLSchema(
"starwars",
"starwars schema at http://try.sangria-graphql.org/graphql",
Def.task(
GraphQLSchemaLoader
.fromIntrospection("http://try.sangria-graphql.org/graphql", streams.value.log)
.loadSchema()
).taskValue
),
)
8 changes: 8 additions & 0 deletions test-project/server/src/it/graphql/heroAndFriends.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
query HeroAndFriends {
hero {
name
friends {
name
}
}
}

0 comments on commit 3adcbae

Please sign in to comment.