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 schema directly in Go.

To that end this library initially has not emphasized GraphQL schema definition parsing and instead focuses on Query Documents and writing real servers.

license: ISC

version: Based on October2015 GraphQL Specification

status: unstable

contributions: encouraged

hacking

  • go generate ./...
  • go test ./...
Owner
Travis Cline
🚀
Travis Cline
Comments
  • schema print

    schema print

    Is there an option to print the schema as json. This is needed to use with relay for validation. similar to https://github.com/relayjs/relay-starter-kit/blob/master/scripts/updateSchema.js

  • support introspection query from graphiql

    support introspection query from graphiql

    As mentioned in https://github.com/tmc/graphql/pull/3

    When connect with graphiql, the initial introspection query gives error.

    error: {message: "No handler for field 'queryType' on type '*schema.Schema'"}
    

    query: (as see in the terminal log)

      query IntrospectionQuery {
        __schema {
          queryType { name }
          mutationType { name }
          types {
            ...FullType
          }
          directives {
            name
            description
            args {
              ...InputValue
            }
            onOperation
            onFragment
            onField
          }
        }
      }
    
      fragment FullType on __Type {
        kind
        name
        description
        fields {
          name
          description
          args {
            ...InputValue
          }
          type {
            ...TypeRef
          }
          isDeprecated
          deprecationReason
        }
        inputFields {
          ...InputValue
        }
        interfaces {
          ...TypeRef
        }
        enumValues {
          name
          description
          isDeprecated
          deprecationReason
        }
        possibleTypes {
          ...TypeRef
        }
      }
    
      fragment InputValue on __InputValue {
        name
        description
        type { ...TypeRef }
        defaultValue
      }
    
      fragment TypeRef on __Type {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
            }
          }
        }
      }
    

    ref https://github.com/graphql/graphql-js/blob/master/src/utilities/introspectionQuery.js

  • Kind of types support

    Kind of types support

    Hi, thanks for a well written library.

    I'm trying to add GraphiQL support to handler and got some errors in introspection query because the returned schema is missing the "kind" of types(OBJECT, INT, STRING etc.).

    I can't find in the source code any reference to kind implementation.

    Do I need to implement it by myself or have I missed something?

  • How to parse variables and operationName ?

    How to parse variables and operationName ?

    I want to pass this string and get it parse, can someone help please?

    { "operationName":"myOperation", "variables":{ "var1":216 }, "query":"query myOperation($var1: Int!) {\n myOperation(var1: $var1) {\n basic_info {\n id\n name\n mobile\n alt_mobile\n image_url\n language\n __typename\n }\n profile_details {\n employee_type\n __typename\n }\n __typename\n }\n}\n" }

  • Schema Incomplete?

    Schema Incomplete?

    Hey there!

    I came across this project and was really excited. I had been planning on implementing a GraphQL server in Go, and now I don't have to [=

    I decided to try adding the Star Wars Schema tests from Facebook's sample implementation in JS but ran into a few issues. You can see my start in this commit, but I'm getting confused on how to put together a more complicated, typed schema. I couldn't find any examples or tests in your repo.

    It looks to me like some of the schema definition stuff might not be complete? I'd be happy to work on this, but wanted to make sure I wasn't just mis-interpreting what's here already.

    Thanks in advance!

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

Jul 10, 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

Dec 28, 2022
GraphQL server with a focus on ease of use
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

Dec 31, 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

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

Oct 26, 2022
GraphQL server with a focus on ease of use
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

Dec 25, 2022
GQLEngine is the best productive solution for implementing a GraphQL server 🚀

GQLEngine is the best productive solution for implementing a graphql server for highest formance examples starwars: https://github.com/gqlengine/starw

Apr 24, 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

Dec 24, 2022
go generate based graphql server library
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

Dec 31, 2022
gqlanalysis makes easy to develop static analysis tools for GraphQL in Go.
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

Dec 14, 2022
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

Dec 27, 2022
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

Dec 21, 2022
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

Nov 20, 2022
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

Jan 8, 2022
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

Dec 6, 2022
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

Dec 7, 2021
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

Jan 4, 2022
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

Dec 11, 2022
A simple (yet effective) GraphQL to HTTP / REST router

ReGraphQL A simple (yet effective) GraphQL to REST / HTTP router. ReGraphQL helps you expose your GraphQL queries / mutations as REST / HTTP endpoints

Dec 12, 2022