File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
src/content/code/language-support/scala Expand file tree Collapse file tree 2 files changed +3
-6
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -8,14 +8,11 @@ github: ghostdogpr/caliban
8
8
An example of a GraphQL schema and query with ` caliban ` :
9
9
``` scala
10
10
case class Character (name : String , age : Int )
11
- def getCharacters (): List [Character ] = ???
12
- def getCharacter (name : String ): Option [Character ] = ???
11
+ def getCharacters (): List [Character ] = ???
13
12
// schema
14
- case class CharacterName (name : String )
15
- case class Queries (characters : List [Character ],
16
- character : CharacterName => Option [Character ])
13
+ case class Queries (characters : List [Character ])
17
14
// resolver
18
- val queries = Queries (getCharacters, args => getCharacter(args.name) )
15
+ val queries = Queries (getCharacters)
19
16
import caliban .GraphQL .graphQL
20
17
import caliban .RootResolver
21
18
val api = graphQL(RootResolver (queries))
You can’t perform that action at this time.
0 commit comments