Code Monkey home page Code Monkey logo

graphqld's Introduction

GraphqlD: A graphql implementation for the D Programming language

CI

Graphql is a query language for apis. Given a query like for the schema in folder test.

{
  shipsselection(ids:[44,45]) {
    id
    commander {
      name
    }
  }
}

You get back json that looks like:

{
  "error": [],
  "data": {
    "shipsselection": [
      {
        "id": 44,
        "commander": {
          "name": "Kathryn Janeway"
        }
      },
      {
        "id": 45,
        "commander": {
          "name": "Jonathan Archer"
        }
      }
    ]
  }
}

Graphiql type-ahead works, this makes schema introspection a lot nicer.

Features

This graphql implementation is based on June 2018 spec.

Operation Execution

  • Scalars
  • Objects
  • Lists of objects/interfaces
  • Interfaces
  • Unions
  • Arguments
  • Variables
  • Fragments
  • Directives
    • Include
    • Skip
    • [?] Custom (Requires changing the graphqld source)
  • Enumerations
  • Input Objects
  • Mutations
  • Subscriptions (This needs vibe.d websocket integration)
  • Async execution (when used with vibe.d blocking resolver are async by default)

Validation

  • Arguments of correct type
  • Default values of correct type
  • Fields on correct type
  • Fragments on composite types
  • Known argument names
  • Executable Definition
  • Known directives
  • Known fragment names
  • Known type names
  • Lone anonymous operations
  • No fragment cycles
  • No undefined variables
  • No unused fragments
  • No unused variables
  • Overlapping fields can be merged (this is done during execution)
  • Possible fragment spreads
  • Provide non-null arguments
  • Scalar leafs
  • Unique argument names
  • Unique directives per location
  • Unique fragment names
  • Unique input field names
  • Unique operation names
  • Unique variable names
  • Variables are input types (this is actually a strange requirement)
  • Variables in allowed position
  • Single root field

Schema Introspection

  • __typename
  • __type
    • name
    • kind
    • description
    • fields
    • interfaces
    • possibleTypes
    • enumValues
    • inputFields
    • ofType
  • __schema
    • types
    • queryType
    • mutationType
    • subscriptionType
    • directives

Comfort Features

  • Query AST cache
  • Json to resolver argument extractor
  • SQL query generation from AST
  • Custom Leaf types (e.g. GQLDCustomLeaf!(std.datetime.DateTime))

Thank you to graphql-dot for the excelent list of features

Documentation

The Documentation is still WIP, please have a look at the vibe.d project in the test folder. This file gives a good overview on how to use graphqld with vibe.d.

Contributing

PRs are always welcome!

About Kaleidic Associates

We are a boutique consultancy that advises a small number of hedge fund clients. We are not accepting new clients currently, but if you are interested in working either remotely or locally in London or Hong Kong, and if you are a talented hacker with a moral compass who aspires to excellence then feel free to drop me a line: laeeth at kaleidic.io

We work with our partner Symmetry Investments, and some background on the firm can be found here:

http://symmetryinvestments.com/about-us/

graphqld's People

Contributors

aminya avatar burner avatar jmt-lab avatar john-colvin avatar schveiguy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.