Slides can be found here
In this application you can create users
, repos
and forks
and also import them from Github
.
Application is in graphql
package.
To start server
- have docker installed
- run
graphql.CalibanApp
- open http://localhost:8088/graphiql
If you want to run it against local postgres
- go to
CalibanApp
and setupcustomLayer
- setup db in
application.conf
or overwrite itenv.conf
If you enable authorization in graphql.package.resolver
and you can test it by inputting token
to top right corner in graphiql e.g. {"name": "String", "roles": ["VIEWER"]}
- caliban - graphql server
- caliban-client - graphql client
- zio - effect
- http4s - web server
- circe - json
- doobie and quill - database
- sttp - http client
- shapeless - just for type tags
- testcontainers-scala - postgresql in docker container in tests
- flyway - migrations
Tests are written in markdown files. Single file represent single request. One directory is a test suite.
Requests/files are executes sequentially ordered by file names. To create test you need only extend
GQLTestBase
as it is done in UserTest. You can store values to
cache between requests by using <<<
and read them by using <<<
as you can see in
01_create-user.md. Stored value might be any json, not
just string. String is used only as a placeholder.
Example package contains examples shown in the talk which were not part of our application:
- GithubQuery - standalone example showing how to call
Github
graphql api with the help ofcaliban-client
- MagnoliaExample -
Magnolia
simple use case - used inCaliban
for typeclass derivations - SlideExamples - examples which were on the slides
- ZIOFirstExample - simple
ZIO
app - ZIOTypeInference - example how type inference works in
ZIO
Client was generated via
calibanGenClient src/main/resources/schema.docs.graphql src/main/scala/graphql/GithubApi.scala