Giter Site home page Giter Site logo

graphql's Introduction

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 ./...

graphql's People

Contributors

nathanborror avatar tmc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphql's Issues

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 ?

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?

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!

support introspection query from graphiql

As mentioned in #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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.