Skip to content

Commit 0e25a8f

Browse files
Add new eggql Go server library to Code Page
1 parent 65eddec commit 0e25a8f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: EGGQL
3+
description: Easy to use, complete Go implementation of GraphQL. Simple and schema-less.
4+
url: https://github.com/AndrewWPhillips/eggql
5+
github: andrewwphillips/eggql
6+
---
7+
8+
The purpose of Eggql is to make it as simple as possible to create a GraphQL server. You don't need to create GraphQL schema (though you can view the schema that is created if interested). It is currently in beta release but is a complete implementation of a GraphQL server apart from subscriptions.
9+
10+
Just to be clear it supports all of these GraphQL features: arguments (including defaults), objects/lists/enums/input/interface/union types, aliases, fragments, variables, directives, mutations, inline fragments, descriptions, introspection and custom scalars.
11+
12+
Tests (jMeter) show that it is as fast or faster than other Go implementations for simple queries. We're working on enhancements for performance including caching, data-loader, complexity-limits, etc.
13+
14+
To run an `eggql` hello world server just build and run this Go program:
15+
16+
17+
```Go
18+
package main
19+
20+
import "github.com/andrewwphillips/eggql"
21+
22+
func main() {
23+
http.Handle("/graphql", eggql.New(struct{ Message string }{Message: "hello, world"}))
24+
http.ListenAndServe(":80", nil)
25+
}
26+
```
27+
28+
This creates a root Query object with a single `message` field. To test it send a query with curl:
29+
30+
```sh
31+
$ curl -XPOST -d '{"query": "{ message }"}' localhost:80/graphql
32+
```
33+
34+
and you will get this response:
35+
36+
```JSON
37+
{
38+
"data": {
39+
"message": "hello, world"
40+
}
41+
}
42+
```

0 commit comments

Comments
 (0)