Skip to content

Commit

Permalink
Fix links to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostdogpr committed Apr 27, 2021
1 parent ff173a3 commit f198bd5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions vuepress/docs/docs/examples.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Examples
The [examples](https://github.com/ghostdogpr/caliban/tree/master/examples/) project in Github contains various examples:
- [GraphQL API exposed with http4s](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/http4s)
- [GraphQL API exposed with Akka HTTP](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/akkahttp)
- [GraphQL API exposed with finch](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/finch)
- [GraphQL API exposed with play](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/play)
- [GraphQL Client usage](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/client)
- [Optimization with ZQuery](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/optimizations)
- [Interop with Cats Effect](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/interop/cats)
- [Interop with Monix](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/interop/monix)
- [Interop with Tapir](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/tapir)
- [Apollo Federation usage](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/federation)
- [GraphQL API exposed with http4s](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/http4s)
- [GraphQL API exposed with Akka HTTP](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/akkahttp)
- [GraphQL API exposed with finch](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/finch)
- [GraphQL API exposed with play](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/play)
- [GraphQL Client usage](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/client)
- [Optimization with ZQuery](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/optimizations)
- [Interop with Cats Effect](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/interop/cats)
- [Interop with Monix](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/interop/monix)
- [Interop with Tapir](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/tapir)
- [Apollo Federation usage](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/federation)

You may also check out [the repository](https://github.com/ghostdogpr/caliban-blog-series) accompanying my [blog series](https://medium.com/@ghostdogpr/graphql-in-scala-with-caliban-part-1-8ceb6099c3c2) on Caliban.
2 changes: 1 addition & 1 deletion vuepress/docs/docs/federation.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ an `A` which has an implicit `ArgBuilder` and an `Option[Out]` where `Out` has a
federate(schema, aResolver, additionalResolvers:_*)
```

You can now use the resulting `GraphQL[R]` to start querying. You can also see the full code example [here](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/federation)
You can now use the resulting `GraphQL[R]` to start querying. You can also see the full code example [here](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/federation)

## Tracing

Expand Down
6 changes: 3 additions & 3 deletions vuepress/docs/docs/interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object ExampleCatsInterop extends IOApp {
}
```

You can find this example within the [examples](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/caliban/interop/cats/ExampleCatsInterop.scala) project.
You can find this example within the [examples](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/example/interop/cats/ExampleCatsInterop.scala) project.

## Monix
You first need to import `caliban.interop.monix.implicits._` and have an implicit `zio.Runtime` in scope. Then a few helpers are available:
Expand Down Expand Up @@ -92,7 +92,7 @@ object ExampleMonixInterop extends TaskApp {
}
```

You can find this example within the [examples](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/caliban/interop/monix/ExampleMonixInterop.scala) project.
You can find this example within the [examples](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/example/interop/monix/ExampleMonixInterop.scala) project.

## Tapir

Expand Down Expand Up @@ -142,7 +142,7 @@ This can then be used to generate both an HTTP route (e.g. `toRoutes` with http4
val api: GraphQL[Any] = addBookEndpoint.toGraphQL
```

You can find a [full example](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/tapir) on github.
You can find a [full example](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/tapir) on github.

### GraphQL restrictions

Expand Down
4 changes: 2 additions & 2 deletions vuepress/docs/docs/optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ During the query execution, Caliban will merge all the requested fields that ret

The [examples](https://github.com/ghostdogpr/caliban/tree/master/examples) project provides 2 versions of the problem described in [this article about GraphQL query optimization](https://blog.apollographql.com/optimizing-your-graphql-request-waterfalls-7c3f3360b051):

- a [naive](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/optimizations/NaiveTest.scala) version where fields are just returning `IO`, resulting in 47 requests
- an [optimized](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/caliban/optimizations/OptimizedTest.scala) version where fields are returning `ZQuery`, resulting in 8 requests only
- a [naive](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/optimizations/NaiveTest.scala) version where fields are just returning `IO`, resulting in 47 requests
- an [optimized](https://github.com/ghostdogpr/caliban/tree/master/examples/src/main/scala/example/optimizations/OptimizedTest.scala) version where fields are returning `ZQuery`, resulting in 8 requests only

::: tip
When all your effects are wrapped with `ZQuery.fromRequest`, it is recommended to use `queryExecution = QueryExecution.Batched` instead of the default `QueryExecution.Parallel`.
Expand Down
4 changes: 2 additions & 2 deletions vuepress/docs/faq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ val api = api1 |+| api2

### How to deal with authentication/authorization?

This is typically handled with the help of ZIO environment. You can make your field require an `Auth` service by returning a `ZIO[Auth, E, A]`. Then, in your resolver, access the `Auth` service to check you have the appropriate permissions. You can inject the authentication information using a middleware in your HTTP server library. Check [here](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/caliban/http4s/AuthExampleApp.scala) for a full example using http4s.
This is typically handled with the help of ZIO environment. You can make your field require an `Auth` service by returning a `ZIO[Auth, E, A]`. Then, in your resolver, access the `Auth` service to check you have the appropriate permissions. You can inject the authentication information using a middleware in your HTTP server library. Check [here](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/example/http4s/AuthExampleApp.scala) for a full example using http4s.

### I have 2 case classes with the same name (different packages). How to avoid conflicts?

Expand All @@ -50,7 +50,7 @@ Unfortunately, it is not supported by the GraphQL spec. See [https://github.com/

### How to deal with recursive types?

Recursive types can be a little tricky. This is not a silver bullet but usually the trick is to add an `implicit lazy val` instance of `Schema` for the type that is recursive. See [here](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/caliban/optimizations/NaiveTest.scala#L82) for an example.
Recursive types can be a little tricky. This is not a silver bullet but usually the trick is to add an `implicit lazy val` instance of `Schema` for the type that is recursive. See [here](https://github.com/ghostdogpr/caliban/blob/master/examples/src/main/scala/example/optimizations/NaiveTest.scala#L82) for an example.

### I'm getting a "Method too large" compiler error.

Expand Down

0 comments on commit f198bd5

Please sign in to comment.