GitHub Hot Board

GitHub Hot Board · 저장소 아카이브

graphql-go/graphql

An implementation of GraphQL for Go / Golang (소개는 저장소 자체 문서에서 왔습니다.)

데이터 기준 October 25graphql-go

최고 순위

#442

종합 · Go 언어별

10K

누적 스타

850

포크 수

0

최근 30일 기록 일수

프로젝트 상태라이선스: MIT최근 push: June 23열린 이슈(PR 포함): 247

2026-10-25부터 수집. 미확인 = 아직 미수집

README에 뱃지를 붙여보세요 · graphql-go/graphql[![README에 뱃지를 붙여보세요](https://git.vaiox.xyz/api/badge/graphql-go/graphql.svg)](https://git.vaiox.xyz/ko/repo/graphql-go/graphql)
<a href="https://git.vaiox.xyz/ko/repo/graphql-go/graphql"><img src="https://git.vaiox.xyz/api/badge/graphql-go/graphql.svg" alt="README에 뱃지를 붙여보세요" height="20"></a>

프로젝트 문서

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

Contribute Back

Friendly reminder links are available in case you would like to contribute back into our commitment with Go and open-source.

Author PayPal Link
Hafiz Ismail Not available yet.
Chris Ramón https://www.paypal.com/donate/?hosted_button_id=WHUQQYEMTRQBJ

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

현재 순위

  • 442

    종합 랭킹 · 역대 최강 · Go

    10K 스타 · 850 fork · 총 스타 수

    종합 · Go →

최근 30일 추이

최근 30일간 기록이 없습니다.

비슷한 프로젝트 · 공유 토픽

← 랭킹으로