Skip to content

Add new eggql Go server library to Code Page #1232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: EGGQL
description: Easy to use, complete Go implementation of GraphQL. Simple and schema-less.
url: https://github.com/AndrewWPhillips/eggql
github: andrewwphillips/eggql
---

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.

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.

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.

To run an `eggql` hello world server just build and run this Go program:


```Go
package main

import "github.com/andrewwphillips/eggql"

func main() {
http.Handle("/graphql", eggql.New(struct{ Message string }{Message: "hello, world"}))
http.ListenAndServe(":80", nil)
}
```

This creates a root Query object with a single `message` field. To test it send a query with curl:

```sh
$ curl -XPOST -d '{"query": "{ message }"}' localhost:80/graphql
```

and you will get this response:

```JSON
{
"data": {
"message": "hello, world"
}
}
```