GQLEngine is the best productive solution for implementing a GraphQL server 🚀

Overview

GQLEngine is the best productive solution for implementing a graphql server for highest formance

examples

Getting started

Get the module:

go get -u github.com/gqlengine/gqlengine

main.go

package main

import (
  "net/http"

  "github.com/gqlengine/gqlengine"
)

func main() {
  engine := gqlengine.NewEngine(gqlengine.Options{
	Tracing: true, // enable tracing extensions
  })
  
  // register your queries, mutations and subscriptions
  engine.NewQuery(mySimpleQuery)
  
  // do NOT forget init the engine
  if err := engine.Init(); err != nil {
    panic(err)
  }
  
  // serve for HTTP
  http.HandleFunc("/api/graphql", engine.ServeHTTP)
  if err := http.ListenAndServe(":8000", nil); err != nil {
    panic(err)
  }
}

api.go

package main

type MyInfo struct {
  gqlengine.IsGraphQLObject `gqlDesc:"my info"`
  SaySomething string
}

func mySimpleQuery() error {
  panic("not implemented")
}

use playground

go get -u github.com/gqlengine/playground

update the code

...

import (
  "github.com/gorilla/mux"
  "github.com/gqlengine/playground"
)

...

func main() {
  
  ... // init your gql engine
  
  playground.SetEndpoints("/api/graphql", "/api/graphql/subscriptions")
  
  // recommends to use 'gorilla/mux' to serve the playground web assets
  r := mux.NewRouter()
  r.HandleFunc("/api/graphql", engine.ServeHTTP)
  r.HandleFunc("/api/graphql/subscriptions", engine.ServeWebsocket)
  r.PathPrefix("/api/graphql/playground").
    Handler(http.StripPrefix("/api/graphql/playground",
      http.FileServer(playground.WebBundle)))

  println("open playground http://localhost:9996/api/graphql/playground/")
  if err := http.ListenAndServe(":9996", r); err != nil {
    panic(err)
  }
}

open browser, you can get the playground all in box

Features

  • Basic features
    • Object type reflection
    • Interface pre-register
    • Union pre-register
    • Enum reflection
    • Scalar reflection
    • Input reflection
    • Arguments reflection
  • Subscription (Integerates Websocket)
  • Multipart Upload (Upload images/files in graphql query)
  • Custom ID
  • Tracing extensions
  • document tags
  • operation hijacking
You might also like...
Tools to write high performance GraphQL applications using Go/Golang.

graphql-go-tools Sponsors WunderGraph Are you looking for a GraphQL e2e data fetching solution? Supports frameworks like NextJS, type safety with gene

Go monolith with embedded microservices including GRPC,REST,GraphQL and The Clean Architecture.
Go monolith with embedded microservices including GRPC,REST,GraphQL and The Clean Architecture.

GoArcc - Go monolith with embedded microservices including GRPC,REST, graphQL and The Clean Architecture. Description When you start writing a Go proj

GraphQL implementation for click house in Go.
GraphQL implementation for click house in Go.

clickhouse-graphql-go GraphQL implementation for clickhouse in Go. This package stores real time streaming websocket data in clickhouse and uses Graph

GraphQL parser comparison in different languages

graphql-parser-bench Parsing a schema or document can be a critical part of the application, especially if you have to care about latency. This is the

A simple Go, GraphQL, and PostgreSQL starter template

Simple Go/GraphQL/PostgreSQL template Purpose Have a good starting point for any project that needs a graphql, go, and postgres backend. It's a very l

A GraphQL complete example using Golang And PostgreSQL

GraphQL with Golang A GraphQL complete example using Golang & PostgreSQL Installation Install the dependencies go get github.com/graphql-go/graphql go

This app is an attempt towards using go lang with graphql data fetch in react front end.

go_movies _A React js + GraphQL supported with backend in GoLang. This app is an attempt towards using go lang with graphql data fetch in react front

proof-of-concept minimal GraphQL service for LTV

LTV GraphQL Proof-of-Concept This is a barebones proof-of-concept of a possible GraphQL implementation that interacts with Core. It includes a few ver

Learn GraphQL with THE IDOLM@STER SHINY COLORS.

faaaar Learn GraphQL with THE IDOLM@STER SHINY COLORS. Getting Started The following is a simple example which get information about 20-year-old idols

Owner
null
GraphQL server with a focus on ease of use

graphql-go The goal of this project is to provide full support of the GraphQL draft specification with a set of idiomatic, easy to use Go packages. Wh

null 4.3k Dec 31, 2022
GraphQL server with a focus on ease of use

graphql-go The goal of this project is to provide full support of the GraphQL draft specification with a set of idiomatic, easy to use Go packages. Wh

null 4.3k Dec 25, 2022
go generate based graphql server library

gqlgen What is gqlgen? gqlgen is a Go library for building GraphQL servers without any fuss. gqlgen is based on a Schema first approach — You get to D

99designs 8.5k Dec 31, 2022
Fast :zap: reverse proxy in front of any GraphQL server for caching, securing and monitoring.

Fast ⚡ reverse proxy in front of any GraphQL server for caching, securing and monitoring. Features ?? Caching RFC7234 compliant HTTP Cache. Cache quer

GBox Proxy 25 Nov 5, 2022
A collection of Go packages for creating robust GraphQL APIs

api-fu api-fu (noun) (informal) Mastery of APIs. ?? Packages The top level apifu package is an opinionated library that aims to make it as easy as pos

Chris 45 Dec 28, 2022
graphql parser + utilities

graphql utilities for dealing with GraphQL queries in Go. This package focuses on actually creating GraphQL servers and expects you to describe your s

Travis Cline 58 Dec 20, 2022
An implementation of GraphQL for Go / Golang

graphql An implementation of GraphQL in Go. Follows the official reference implementation graphql-js. Supports: queries, mutations & subscriptions. Do

null 9k Dec 26, 2022
Convert Golang Struct To GraphQL Object On The Fly

Straf Convert Golang Struct To GraphQL Object On The Fly Easily Create GraphQL Schemas Example Converting struct to GraphQL Object type UserExtra stru

Roshan Mehta 34 Oct 26, 2022
⚡️ A Go framework for rapidly building powerful graphql services

Thunder is a Go framework for rapidly building powerful graphql servers. Thunder has support for schemas automatically generated from Go types, live q

null 1.6k Dec 24, 2022
gqlanalysis makes easy to develop static analysis tools for GraphQL in Go.

gqlanalysis gqlanalysis defines the interface between a modular static analysis for GraphQL in Go. gqlanalysis is inspired by go/analysis. gqlanalysis

null 38 Dec 14, 2022