All Projects → graphql-go → Graphql

graphql-go / Graphql

Licence: mit
An implementation of GraphQL for Go / Golang

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Graphql

Hype Beats
Real-time Collaborative Beatbox with React & GraphQL
Stars: ✭ 100 (-98.78%)
Mutual labels:  graphql, subscriptions
Subscriptions Transport Sse
A Server-Side-Events (SSE) client + server for GraphQL subscriptions
Stars: ✭ 55 (-99.33%)
Mutual labels:  graphql, subscriptions
Moviesapp
React Native Movies App: AWS Amplify, AWS AppSync, AWS Cognito, GraphQL, DynamoDB
Stars: ✭ 78 (-99.05%)
Mutual labels:  graphql, subscriptions
Mercure
Server-sent live updates: protocol and reference implementation
Stars: ✭ 2,608 (-68.1%)
Mutual labels:  graphql, subscriptions
Aws Lambda Graphql
Use AWS Lambda + AWS API Gateway v2 for GraphQL subscriptions over WebSocket and AWS API Gateway v1 for HTTP
Stars: ✭ 313 (-96.17%)
Mutual labels:  graphql, subscriptions
Gqlgen
go generate based graphql server library
Stars: ✭ 6,880 (-15.85%)
Mutual labels:  graphql, subscriptions
Graphql Ws
Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.
Stars: ✭ 398 (-95.13%)
Mutual labels:  graphql, subscriptions
Kikstart Graphql Client
🚀 Small NodeJS Wrapper around apollo-client that provides easy access to running queries, mutations and subscriptions.
Stars: ✭ 27 (-99.67%)
Mutual labels:  graphql, subscriptions
Nextjs Graphql Sample
A simple app to demonstrate basic API functions built with REST and GraphQL
Stars: ✭ 29 (-99.65%)
Mutual labels:  graphql
Graphql Upload
Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various GoLang GraphQL servers
Stars: ✭ 32 (-99.61%)
Mutual labels:  graphql
Navalia
A bullet-proof, fast, and reliable headless browser API
Stars: ✭ 950 (-88.38%)
Mutual labels:  graphql
Link state demo
🚀 Demonstrate how to support multiple stores in Apollo Link State
Stars: ✭ 30 (-99.63%)
Mutual labels:  graphql
Graphql Client
A Ruby library for declaring, composing and executing GraphQL queries
Stars: ✭ 961 (-88.25%)
Mutual labels:  graphql
Catalyst
Typescript NodeJS Microservices Boilerplate with Generator CLI - Moleculer, GraphQL, REST, OAuth2, Jaeger, Grafana, Prometheus, Ory Hydra, Ory Keto w/ Access Control middleware, Moleculer-DB GraphQL mixin, Pug, Redis, sibling client repo (login, persistance layer, react-native-web, ios, android)
Stars: ✭ 30 (-99.63%)
Mutual labels:  graphql
Graphql Music
🎸A workshop in building a GraphQL API
Stars: ✭ 33 (-99.6%)
Mutual labels:  graphql
Graphql Parser Php
A PHP extension wrapping the libgraphqlparser library for parsing GraphQL.
Stars: ✭ 29 (-99.65%)
Mutual labels:  graphql
Registration
Powerful and extensible registration system for hackathons and other large events
Stars: ✭ 29 (-99.65%)
Mutual labels:  graphql
Gridsome
⚡️ The Jamstack framework for Vue.js
Stars: ✭ 8,022 (-1.88%)
Mutual labels:  graphql
Cms
Statamic 3: The Core Composer Package
Stars: ✭ 965 (-88.2%)
Mutual labels:  graphql
Graphql Modules
Enterprise Grade Tooling For Your GraphQL Server
Stars: ✭ 962 (-88.23%)
Mutual labels:  graphql

graphql CircleCI Go Reference Coverage Status Join the chat at https://gitter.im/graphql-go/graphql

An implementation of GraphQL in Go. Follows the official reference implementation graphql-js.

Supports: queries, mutations & subscriptions.

Documentation

godoc: https://pkg.go.dev/github.com/graphql-go/graphql

Getting Started

To install the library, run:

go get github.com/graphql-go/graphql

The following is a simple example which defines a schema with a single hello string-type field and a Resolve method which returns the string world. A GraphQL query is performed against this schema with the resulting output printed in JSON format.

package main

import (
	"encoding/json"
	"fmt"
	"log"

	"github.com/graphql-go/graphql"
)

func main() {
	// Schema
	fields := graphql.Fields{
		"hello": &graphql.Field{
			Type: graphql.String,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				return "world", nil
			},
		},
	}
	rootQuery := graphql.ObjectConfig{Name: "RootQuery", Fields: fields}
	schemaConfig := graphql.SchemaConfig{Query: graphql.NewObject(rootQuery)}
	schema, err := graphql.NewSchema(schemaConfig)
	if err != nil {
		log.Fatalf("failed to create new schema, error: %v", err)
	}

	// Query
	query := `
		{
			hello
		}
	`
	params := graphql.Params{Schema: schema, RequestString: query}
	r := graphql.Do(params)
	if len(r.Errors) > 0 {
		log.Fatalf("failed to execute graphql operation, errors: %+v", r.Errors)
	}
	rJSON, _ := json.Marshal(r)
	fmt.Printf("%s \n", rJSON) // {"data":{"hello":"world"}}
}

For more complex examples, refer to the examples/ directory and graphql_test.go.

Third Party Libraries

Name Author Description
graphql-go-handler Hafiz Ismail Middleware to handle GraphQL queries through HTTP requests.
graphql-relay-go Hafiz Ismail Lib to construct a graphql-go server supporting react-relay.
golang-relay-starter-kit Hafiz Ismail Barebones starting point for a Relay application with Golang GraphQL server.
dataloader Nick Randall DataLoader implementation in Go.

Blog Posts

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].