/graphit

GraphQL custom types collection

Primary LanguageTypeScript

Graphit

Introduction

How to use

As an output

import {
  graphql,
  GraphQLSchema,
  GraphQLObjectType
} from "graphql";
import { GraphitGUID } from "graphit";

const schema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: "RootQueryType",
    fields: {
      hello: {
        type: GraphitGUID(),
        resolve: () => 'uuid'
      }
    }
  })
});

As an intput

import {
  graphql,
  GraphQLSchema,
  GraphQLObjectType
} from "graphql";
import { GraphitGUID } from "graphit";

const schema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: "RootQueryType",
    fields: {
      hello: {
        args: {
          id: { type: GraphitGUID() } 
        }
        type: GraphQLBoolean(),
        resolve: () => true'
      }
    }
  })
});

Documentation