Skip to content

GiraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first approach

License

Notifications You must be signed in to change notification settings

BengtHagemeister/giraphql

This branch is 2067 commits behind hayes/pothos:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

554f860 · Jun 30, 2021
Jun 28, 2021
Oct 21, 2020
Jun 30, 2021
Jun 30, 2021
May 2, 2021
Jun 26, 2020
May 5, 2021
Nov 11, 2019
Nov 9, 2019
Nov 8, 2019
Jun 10, 2021
Feb 13, 2021
Jun 28, 2021
May 5, 2021
Jun 28, 2021
Jun 28, 2021

Repository files navigation

GiraphQL - A plugin based GraphQL schema builder for typescript

GiraphQL makes writing graphql schemas in typescript easy, fast and enjoyable. The core of GiraphQL adds 0 overhead at runtime, and has graphql as its only dependency.

By leaning heavily on typescripts ability to infer types, GiraphQL is the most type-safe way of writing GraphQL schemas in typescript/node while requiring very few manual type definitions and no code generation.

GiraphQL has a unique and powerful plugin system that makes every plugin feel like its features are built into the core library. Plugins can extend almost any part of the API by adding new options or methods that can take full advantage of GiraphQLs type system.

Hello, World

import { ApolloServer } from 'apollo-server';
import SchemaBuilder from '@giraphql/core';

const builder = new SchemaBuilder({});

builder.queryType({
  fields: (t) => ({
    hello: t.string({
      args: {
        name: t.arg.string(),
      },
      resolve: (parent, { name }) => `hello, ${name || 'World'}`,
    }),
  }),
});

new ApolloServer({
  schema: builder.toSchema({}),
}).listen(3000);

Full docs available at https://giraphql.com

Plugins that make GiraphQL even better

  • Add global, type level, or field level authorization checks to your schema
  • Validating your inputs and arguments
  • Quickly define data-loaders for your types and fields to avoid n+1 queries.
  • Easy to use builder methods for defining relay style nodes and connections, and helpful utilities for cursor based pagination.
  • Define simple object types without resolvers or manual type definitions.
  • Add mock resolver for easier testing
  • Build multiple subsets of your graph to easily share code between internal and external APIs.
  • Integrate with existing schema graphql directives in a type-safe way.
  • Make any part of your graph subscribable to get live updates as your data changes.
  • A plugin for easily including error types in your GraphQL schema and hooking up error types to resolvers.

About

GiraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first approach

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%