GGql

June 18, 2021 ยท View on GitHub

A GraphQL implementation for a GraphQL API that is easy to use and understand while still providing good performance.

License Build Status ReportCard go.dev reference Coverage FOSSA Status

Features

  • Simple binding of GraphQL schema elements to golang types and functions.
  • Multiple resolver options including dynamic resolvers.
  • High performance
  • No external dependencies.

News

  • The first release is out! Benchmarks look good, documentation is complete, and examples available.

Using

The examples provide the best explanation for how to use the package.

Installation

go get github.com/uhn/ggql

To build and install the ggqlgen application:

go install ./...

Releases

See CHANGELOG.md

Benchmarks

Benchmarks are against graphql-go which is currently the most common golang GraphQL package. The ggql-i package is using the interface resolvers (Resolver and ListResolver) while the ggql framework is using reflection. For a more comprehensive comparison go to graphql-benchmarks.

Parameters

  • Last updated: 2020-06-10
  • OS: Linux (version: 5.7.1-050701-generic, arch: x86_64)
  • CPU Cores: 12
  • Connections: 1000
  • Duration: 20 seconds
  • Units:
    • Rates are in requests per second.
    • Latency is in milliseconds.
    • Verbosity is the number of non-blank lines of code excluding comments.

Rate

LanguageFramework(version)RateMedian LatencyAverage Latency90th %99th %Std DevVerbosity
go (1.14)ggql-i (1.0.0)2050580.0620.0600.0680.0880.02253
go (1.14)ggql (1.0.0)2019860.0620.0570.0660.0730.02176
go (1.14)graphql-go (0.7.9)328430.0780.0750.0860.1020.03378

Latency

LanguageFramework(version)RateMedian LatencyAverage Latency90th %99th %Std DevVerbosity
go (1.14)ggql-i (1.0.0)2050580.0620.0600.0680.0880.02253
go (1.14)ggql (1.0.0)2019860.0620.0570.0660.0730.02176
go (1.14)graphql-go (0.7.9)328430.0780.0750.0860.1020.03378

Verbosity

LanguageFramework(version)RateMedian LatencyAverage Latency90th %99th %Std DevVerbosity
go (1.14)ggql (1.0.0)2019860.0620.0570.0660.0730.02176
go (1.14)ggql-i (1.0.0)2050580.0620.0600.0680.0880.02253
go (1.14)graphql-go (0.7.9)328430.0780.0750.0860.1020.03378

License

Unless otherwise noted, the GGQL source files are distributed under the Apache Version 2.0 license found in the LICENSE file.

More Information