-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'graphql:source' into custom-speakers-page
- Loading branch information
Showing
10 changed files
with
66 additions
and
13 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
7 changes: 7 additions & 0 deletions
7
src/content/code/language-support/javascript/client/graphql-http.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,7 @@ | ||
--- | ||
name: GraphQL-HTTP | ||
description: Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite. | ||
url: https://github.com/graphql/graphql-http | ||
github: graphql/graphql-http | ||
npm: "graphql-http" | ||
--- |
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
src/content/code/language-support/javascript/server/graphql-http.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,7 @@ | ||
--- | ||
name: GraphQL-HTTP | ||
description: Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite. | ||
url: https://github.com/graphql/graphql-http | ||
github: graphql/graphql-http | ||
npm: "graphql-http" | ||
--- |
7 changes: 7 additions & 0 deletions
7
src/content/code/language-support/javascript/server/graphql-sse.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,7 @@ | ||
--- | ||
name: GraphQL-SSE | ||
description: Zero-dependency, HTTP/1 safe, simple, GraphQL over Server-Sent Events Protocol server and client. | ||
url: https://github.com/enisdenjo/graphql-sse | ||
github: enisdenjo/graphql-sse | ||
npm: "graphql-sse" | ||
--- |
7 changes: 7 additions & 0 deletions
7
src/content/code/language-support/javascript/server/graphql-ws.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,7 @@ | ||
--- | ||
name: GraphQL-WS | ||
description: Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client. | ||
url: https://github.com/enisdenjo/graphql-ws | ||
github: enisdenjo/graphql-ws | ||
npm: "graphql-ws" | ||
--- |
7 changes: 7 additions & 0 deletions
7
src/content/code/language-support/javascript/tools/graphql-http.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,7 @@ | ||
--- | ||
name: GraphQL-HTTP | ||
description: Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite. | ||
url: https://github.com/graphql/graphql-http | ||
github: graphql/graphql-http | ||
npm: "graphql-http" | ||
--- |
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 |
---|---|---|
@@ -1,6 +1,21 @@ | ||
--- | ||
name: Caliban | ||
description: Functional GraphQL library for Scala, with client code generation and type-safe queries. | ||
description: Caliban is a functional library for building GraphQL servers and clients in Scala. It offers with client code generation and type-safe queries. | ||
url: https://ghostdogpr.github.io/caliban/ | ||
github: ghostdogpr/caliban | ||
--- | ||
|
||
An example of defining a GraphQL query and running it with `caliban`: | ||
|
||
```scala | ||
// define your query using Scala | ||
val query: SelectionBuilder[RootQuery, List[CharacterView]] = | ||
Query.characters { | ||
(Character.name ~ Character.nicknames ~ Character.origin) | ||
.mapN(CharacterView) | ||
} | ||
|
||
import sttp.client3._ | ||
// run the query and get the result already parsed into a case class | ||
val result = query.toRequest(uri"http://someUrl").send(HttpClientSyncBackend()).body | ||
``` |
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 |
---|---|---|
@@ -1,30 +1,26 @@ | ||
--- | ||
name: Caliban | ||
description: Caliban is a purely functional library for building GraphQL servers and clients in Scala | ||
description: Caliban is a functional library for building GraphQL servers and clients in Scala. It offers minimal boilerplate and excellent interoperability. | ||
url: https://ghostdogpr.github.io/caliban/ | ||
github: ghostdogpr/caliban | ||
--- | ||
|
||
An example of a GraphQL schema and query with `caliban`: | ||
An example of a simple GraphQL schema and query with `caliban`: | ||
|
||
```scala | ||
import caliban.GraphQL.graphQL | ||
import caliban.RootResolver | ||
|
||
case class Character(name: String, age: Int) | ||
|
||
def getCharacters(): List[Character] = ??? | ||
import caliban._ | ||
import caliban.schema.Schema.auto._ | ||
|
||
// schema | ||
case class Queries(characters: List[Character]) | ||
case class Query(hello: String) | ||
|
||
// resolver | ||
val queries = Queries(getCharacters) | ||
val resolver = RootResolver(Query("Hello world!")) | ||
|
||
val api = graphQL(RootResolver(queries)) | ||
val api = graphQL(resolver) | ||
|
||
for { | ||
interpreter <- api.interpreter | ||
result <- interpreter.execute("{ characters { name } }") | ||
result <- interpreter.execute("{ hello }") | ||
} yield result | ||
``` |