-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 74731ed
Showing
10 changed files
with
129 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# macOS | ||
.DS_Store | ||
|
||
# sbt specific | ||
dist/* | ||
target/ | ||
lib_managed/ | ||
src_managed/ | ||
project/boot/ | ||
project/plugins/project/ | ||
project/local-plugins.sbt | ||
.history | ||
.ensime | ||
.ensime_cache/ | ||
.sbt-scripted/ | ||
local.sbt | ||
|
||
# Bloop | ||
.bsp | ||
|
||
# VS Code | ||
.vscode/ | ||
|
||
# Metals | ||
.bloop/ | ||
.metals/ | ||
metals.sbt | ||
|
||
# IDEA | ||
.idea | ||
.idea_modules | ||
/.worksheet/ |
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,22 @@ | ||
align.multiline = true | ||
align.preset = more | ||
align.stripMargin = true | ||
assumeStandardLibraryStripMargin = true | ||
continuationIndent.defnSite = 2 | ||
danglingParentheses.preset = true | ||
docstrings = JavaDoc | ||
docstrings.style = Asterisk | ||
docstrings.wrap = yes | ||
docstrings.wrapMaxColumn = 80 | ||
includeCurlyBraceInSelectChains = false | ||
lineEndings = preserve | ||
maxColumn = 120 | ||
newlines.afterInfix = keep | ||
optIn.annotationNewlines = true | ||
rewrite.imports.sort = original | ||
rewrite.rules = [Imports, RedundantBraces, SortModifiers] | ||
rewrite.rules = [RedundantParens] | ||
runner.dialect = scala213 | ||
spaces.inImportCurlyBraces = false | ||
trailingCommas = "always" | ||
version = "3.5.3" |
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,8 @@ | ||
## sbt project compiled with Scala 3 | ||
|
||
### Usage | ||
|
||
This is a normal sbt project. You can compile code with `sbt compile`, run it with `sbt run`, and `sbt console` will start a Scala 3 REPL. | ||
|
||
For more information on the sbt-dotty plugin, see the | ||
[scala3-example-project](https://github.com/scala/scala3-example-project/blob/main/README.md). |
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,17 @@ | ||
import Dependencies._ | ||
|
||
val scala3Version = "2.13.8" | ||
|
||
lazy val root = project | ||
.in(file(".")) | ||
.settings( | ||
name := "GraphQLCompose", | ||
version := "0.1.0-SNAPSHOT", | ||
scalaVersion := scala3Version, | ||
libraryDependencies := Seq( | ||
ZIOCore, | ||
ZIOSchema, | ||
ZIOSchemaDerivation, | ||
ZIOTest % Test, | ||
), | ||
) |
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,10 @@ | ||
object Dependencies { | ||
import sbt._ | ||
val zioVersion = "2.0.0" | ||
val zioSchemaVersion = "0.2.0" | ||
|
||
val ZIOCore = "dev.zio" %% "zio" % zioVersion | ||
val ZIOTest = "dev.zio" %% "zio-test" % zioVersion | ||
val ZIOSchema = "dev.zio" %% "zio-schema" % zioSchemaVersion | ||
val ZIOSchemaDerivation = "dev.zio" %% "zio-schema-derivation" % zioSchemaVersion | ||
} |
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 @@ | ||
sbt.version=1.7.1 |
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,8 @@ | ||
package com.tusharmath.compose | ||
|
||
final case class Endpoint(host: String, port: Int, path: String, body: Array[Byte], protocol: Protocol) | ||
|
||
sealed trait Protocol | ||
object Protocol { | ||
case class Http(method: String) extends Protocol | ||
} |
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,15 @@ | ||
package com.tusharmath.compose | ||
|
||
import zio.schema.Schema | ||
|
||
sealed trait GraphQL[-A, +B] {} | ||
|
||
object GraphQL { | ||
case class Constant[B](b: B, schema: Schema[B]) extends GraphQL[Any, B] | ||
case class Identity[A](schema: Schema[A]) extends GraphQL[A, A] | ||
case class Compose[A, B, C](g: GraphQL[B, C], f: GraphQL[A, B]) extends GraphQL[A, C] | ||
case class Zip2[A, B, C](g: GraphQL[A, B], f: GraphQL[A, C]) extends GraphQL[A, (B, C)] | ||
case class Load[A](endpoint: Endpoint, schema: Schema[A]) extends GraphQL[Any, A] | ||
|
||
def constant[A](a: A)(implicit schema: Schema[A]): GraphQL[Any, A] = Constant(a, schema) | ||
} |
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,7 @@ | ||
package com.tusharmath.compose | ||
|
||
object Main extends App { | ||
def hello(): Unit = { | ||
println("Hello!") | ||
} | ||
} |
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,9 @@ | ||
package com.tusharmath.compose | ||
|
||
import com.tusharmath.compose.GraphQLSpec.test | ||
import zio.test.{assertTrue, ZIOSpecDefault} | ||
|
||
object GraphQLSpec extends ZIOSpecDefault: | ||
override def spec = test("Some test") { | ||
assertTrue(true) | ||
} |