Skip to content

Commit 60a8453

Browse files
authored
Merge branch 'graphql:source' into custom-speakers-page
2 parents 38c357d + b52ece7 commit 60a8453

File tree

10 files changed

+66
-13
lines changed

10 files changed

+66
-13
lines changed

gatsby-node.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ export const createPages: GatsbyNode["createPages"] = async ({
191191
toPath: "/conf/schedule",
192192
})
193193

194+
// redirect swapi with 200
195+
createRedirect({
196+
fromPath: `/swapi-graphql/*`,
197+
toPath: `https://graphql.github.io/swapi-graphql/*`,
198+
statusCode: 200,
199+
})
200+
194201
const result = await graphql(`
195202
query allMarkdownRemark {
196203
allMarkdownRemark {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: GraphQL-HTTP
3+
description: Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite.
4+
url: https://github.com/graphql/graphql-http
5+
github: graphql/graphql-http
6+
npm: "graphql-http"
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: GraphQL-HTTP
3+
description: Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite.
4+
url: https://github.com/graphql/graphql-http
5+
github: graphql/graphql-http
6+
npm: "graphql-http"
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: GraphQL-SSE
3+
description: Zero-dependency, HTTP/1 safe, simple, GraphQL over Server-Sent Events Protocol server and client.
4+
url: https://github.com/enisdenjo/graphql-sse
5+
github: enisdenjo/graphql-sse
6+
npm: "graphql-sse"
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: GraphQL-WS
3+
description: Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.
4+
url: https://github.com/enisdenjo/graphql-ws
5+
github: enisdenjo/graphql-ws
6+
npm: "graphql-ws"
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: GraphQL-HTTP
3+
description: Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite.
4+
url: https://github.com/graphql/graphql-http
5+
github: graphql/graphql-http
6+
npm: "graphql-http"
7+
---
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
---
22
name: Caliban
3-
description: Functional GraphQL library for Scala, with client code generation and type-safe queries.
3+
description: Caliban is a functional library for building GraphQL servers and clients in Scala. It offers with client code generation and type-safe queries.
44
url: https://ghostdogpr.github.io/caliban/
55
github: ghostdogpr/caliban
66
---
7+
8+
An example of defining a GraphQL query and running it with `caliban`:
9+
10+
```scala
11+
// define your query using Scala
12+
val query: SelectionBuilder[RootQuery, List[CharacterView]] =
13+
Query.characters {
14+
(Character.name ~ Character.nicknames ~ Character.origin)
15+
.mapN(CharacterView)
16+
}
17+
18+
import sttp.client3._
19+
// run the query and get the result already parsed into a case class
20+
val result = query.toRequest(uri"http://someUrl").send(HttpClientSyncBackend()).body
21+
```
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
---
22
name: Caliban
3-
description: Caliban is a purely functional library for building GraphQL servers and clients in Scala
3+
description: Caliban is a functional library for building GraphQL servers and clients in Scala. It offers minimal boilerplate and excellent interoperability.
44
url: https://ghostdogpr.github.io/caliban/
55
github: ghostdogpr/caliban
66
---
77

8-
An example of a GraphQL schema and query with `caliban`:
8+
An example of a simple GraphQL schema and query with `caliban`:
99

1010
```scala
11-
import caliban.GraphQL.graphQL
12-
import caliban.RootResolver
13-
14-
case class Character(name: String, age: Int)
15-
16-
def getCharacters(): List[Character] = ???
11+
import caliban._
12+
import caliban.schema.Schema.auto._
1713

1814
// schema
19-
case class Queries(characters: List[Character])
15+
case class Query(hello: String)
2016

2117
// resolver
22-
val queries = Queries(getCharacters)
18+
val resolver = RootResolver(Query("Hello world!"))
2319

24-
val api = graphQL(RootResolver(queries))
20+
val api = graphQL(resolver)
2521

2622
for {
2723
interpreter <- api.interpreter
28-
result <- interpreter.execute("{ characters { name } }")
24+
result <- interpreter.execute("{ hello }")
2925
} yield result
3026
```

0 commit comments

Comments
 (0)