File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/content/code/language-support/javascript/tools Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : GiraphQL
3
+ description : A plugin based schema builder for creating code-first GraphQL schemas in typescript
4
+ url : https://giraphql.com/
5
+ github : hayes/giraphql
6
+ npm : " @giraphql/core"
7
+ ---
8
+
9
+ GiraphQL makes writing type-safe schemas simple, and works without a code generator,
10
+ build process, or extensive manual type definitions.
11
+
12
+ ``` ts
13
+ import { ApolloServer } from " apollo-server"
14
+ import SchemaBuilder from " @giraphql/core"
15
+
16
+ const builder = new SchemaBuilder ({})
17
+
18
+ builder .queryType ({
19
+ fields : t => ({
20
+ hello: t .string ({
21
+ args: {
22
+ name: t .arg .string ({}),
23
+ },
24
+ resolve : (parent , { name }) => ` hello, ${name || " World" } ` ,
25
+ }),
26
+ }),
27
+ })
28
+
29
+ new ApolloServer ({
30
+ schema: builder .toSchema ({}),
31
+ }).listen (3000 )
32
+ ```
You can’t perform that action at this time.
0 commit comments