Skip to content

Commit d266e9a

Browse files
authored
Merge pull request graphql#1008 from hayes/patch-1
Add GiraphQL schema builder to list of javascript libraries
2 parents e551e1b + f421540 commit d266e9a

File tree

1 file changed

+32
-0
lines changed
  • src/content/code/language-support/javascript/tools

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
```

0 commit comments

Comments
 (0)