Skip to content

Commit

Permalink
docs: update readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed May 9, 2021
1 parent 44e1f30 commit 07c727b
Show file tree
Hide file tree
Showing 14 changed files with 2,169 additions and 160 deletions.
86 changes: 44 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
# GiraphQL SchemaBuilder
## GiraphQL - A plugin based GraphQL schema builder for typescript

GiraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first
approach. The GiraphQL schema builder makes writing schemas easy by providing a simple clean API
with helpful auto-completes, and removing the need for compile steps or defining the same types in
multiple files.
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.

GiraphQL works in Node, Deno, or even the browser.
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

```typescript
import SchemaBuilder from '@giraphql/core';
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'}`,
}),
fields: (t) => ({
hello: t.string({
args: {
name: t.arg.string({}),
},
resolve: (parent, { name }) => `hello, ${name || 'World'}`,
}),
}),
});

const server = new ApolloServer({
schema: builder.toSchema({}),
});

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

## Full docs available at https://giraphql.com

## Development
## Plugins that make GiraphQL even better

- ## [Scope Auth](plugins/scope-auth.md)
Add global, type level, or field level authorization checks to your schema
- ## [Validation](plugins/validation.md)
Validating your inputs and arguments
- ## [Dataloader](plugins/dataloader.md)
Quickly define data-loaders for your types and fields to avoid n+1 queries.
- ## [Relay](plugins/relay.md)
- Easy to use builder methods for defining relay style nodes and connections, and helpful utilities
for cursor based pagination.
- ## [Simple Objects](plugins/simple-objects.md)
Define simple object types without resolvers or manual type definitions.
- ## [Mocks](plugins/mocks.md)
Add mock resolver for easier testing
- ## [Sub-Graph](plugins/sub-graph.md)
Build multiple subsets of your graph to easily share code between internal and external APIs.
- ## [Directives](plugins/directives.md)
Integrate with existing schema graphql directives in a type-safe way.
- ## [Smart Subscriptions](plugins/smart-subscriptions.md)
Make any part of your graph subscribable to get live updates as your data changes.

### Setup

After cloning run

```bash
yarn install
yarn prepare
yarn build
```

### Scripts

- `yarn prepare`: re-create all the config files for tools used in this repo
- `yarn build`: builds .js and .d.ts files
- `yarn clean`: removes all build artifacts for code and docs
- `yarn lint {path to file/directory}`: runs linter (eslint)
- `yarn jest {path to file/directory}`: run run tests
- `yarn test`: runs typechecking, lint, and tests
- `yarn prettier`: formats code and docs
- `yarn type`: run typechecking
## Full docs available at https://giraphql.com
73 changes: 32 additions & 41 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ name: Overview
route: /
---

# Overview
## GiraphQL - A plugin based GraphQL schema builder for typescript

GiraphQL is a plugin based schema builder for creating code-first GraphQL schemas in 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

Expand All @@ -31,42 +40,24 @@ new ApolloServer({
}).listen(3000);
```

## What GiraphQL offers

* A type safe way to build GraphQL schemas with minimal manual type definitions and no build

process for generating type definitions

* A powerful plugin system that enables extending almost any part of the schema builder, as well

as adding runtime features like authorization.

* A lack of dependencies: GiraphQL uses `graphql` as it's only peer dependency
* A set of plugins for common use cases:
* [`@giraphql/plugin-scope-auth`](plugins/scope-auth.md): A plugin for adding authorization checks

throughout your schema

* [`@giraphql/plugin-relay`](plugins/relay.md): A plugin for adding builder methods for defining

relay style nodes and connections, and some helpful utilities for cursor based pagination

* [`@giraphql/plugin-smart-subscriptions`](plugins/smart-subscriptions.md): A plugin for a more

graph friendly way of defining subscriptions.

* [`@giraphql/plugin-simple-objects`](plugins/simple-objects.md): A plugin for creating simple

objects and interfaces without defining types, resolvers, or arguments.

* [`@giraphql/plugin-mocks`](plugins/mocks.md): A plugin for mocking out resolvers in your schema.
* [`@giraphql/plugin-sub-graph`](plugins/sub-graph.md): A plugin for creating sub selections of

your graph.

* [`@giraphql/plugin-directives`](plugins/directives.md): A plugin for using directives with

GiraphQL schemas.

* [`@giraphql/plugin-validation`](plugins/validation.md): A plugin for validating arguments.

## Plugins that make GiraphQL even better

- ## [Scope Auth](plugins/scope-auth.md)
Add global, type level, or field level authorization checks to your schema
- ## [Validation](plugins/validation.md)
Validating your inputs and arguments
- ## [Dataloader](plugins/dataloader.md)
Quickly define data-loaders for your types and fields to avoid n+1 queries.
- ## [Relay](plugins/relay.md)
- Easy to use builder methods for defining relay style nodes and connections, and helpful utilities
for cursor based pagination.
- ## [Simple Objects](plugins/simple-objects.md)
Define simple object types without resolvers or manual type definitions.
- ## [Mocks](plugins/mocks.md)
Add mock resolver for easier testing
- ## [Sub-Graph](plugins/sub-graph.md)
Build multiple subsets of your graph to easily share code between internal and external APIs.
- ## [Directives](plugins/directives.md)
Integrate with existing schema graphql directives in a type-safe way.
- ## [Smart Subscriptions](plugins/smart-subscriptions.md)
Make any part of your graph subscribable to get live updates as your data changes.
72 changes: 36 additions & 36 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Table of contents

* [Overview](README.md)
* [Guide](guide/README.md)
* [Object Types](guide/objects.md)
* [SchemaBuilder](guide/schema-builder.md)
* [Fields](guide/fields.md)
* [Args](guide/args.md)
* [Context object](guide/context.md)
* [Input Objects](guide/inputs.md)
* [Enums](guide/enums.md)
* [Scalars](guide/scalars.md)
* [Interfaces](guide/interfaces.md)
* [Unions](guide/unions.md)
* [Using Plugins](guide/using-plugins.md)
* [App layout](guide/app-layout.md)
* [Printing Schema](guide/printing-schemas.md)
* [Changing Default Nullability](guide/changing-default-nullability.md)
* [Writing Plugins](guide/writing-plugins.md)
* [Deno](guide/deno.md)
* [Plugins](plugins/README.md)
* [Auth Plugin](plugins/scope-auth.md)
* [Mocks Plugin](plugins/mocks.md)
* [Relay Plugin](plugins/relay.md)
* [Simple Objects Plugin](plugins/simple-objects.md)
* [Smart Subscriptions Plugin](plugins/smart-subscriptions.md)
* [SubGraph Plugin](plugins/sub-graph.md)
* [Directives Plugin](plugins/directives.md)
* [Validation Plugin](plugins/validation.md)
* [API](api/README.md)
* [SchemaBuilder](api/schema-builder.md)
* [FieldBuilder](api/field-builder.md)
* [ArgBuilder](api/arg-builder.md)
* [InputFieldBuilder](api/input-field-builder.md)
* [Design](design.md)
* [Migrations](migrations/README.md)
* [v2.0](migrations/2.0.md)

- [Overview](README.md)
- [Guide](guide/README.md)
- [Object Types](guide/objects.md)
- [SchemaBuilder](guide/schema-builder.md)
- [Fields](guide/fields.md)
- [Args](guide/args.md)
- [Context object](guide/context.md)
- [Input Objects](guide/inputs.md)
- [Enums](guide/enums.md)
- [Scalars](guide/scalars.md)
- [Interfaces](guide/interfaces.md)
- [Unions](guide/unions.md)
- [Using Plugins](guide/using-plugins.md)
- [App layout](guide/app-layout.md)
- [Printing Schema](guide/printing-schemas.md)
- [Changing Default Nullability](guide/changing-default-nullability.md)
- [Writing Plugins](guide/writing-plugins.md)
- [Deno](guide/deno.md)
- [Plugins](plugins/README.md)
- [Auth](plugins/scope-auth.md)
- [Dataloader](plugins/dataloader.md)
- [Directives](plugins/directives.md)
- [Mocks](plugins/mocks.md)
- [Relay](plugins/relay.md)
- [Simple Objects](plugins/simple-objects.md)
- [Smart Subscriptions](plugins/smart-subscriptions.md)
- [SubGraph](plugins/sub-graph.md)
- [Validation](plugins/validation.md)
- [API](api/README.md)
- [SchemaBuilder](api/schema-builder.md)
- [FieldBuilder](api/field-builder.md)
- [ArgBuilder](api/arg-builder.md)
- [InputFieldBuilder](api/input-field-builder.md)
- [Design](design.md)
- [Migrations](migrations/README.md)
- [v2.0](migrations/2.0.md)
32 changes: 19 additions & 13 deletions docs/plugins/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Plugins

- [`@giraphql/plugin-scope-auth`](scope-auth.md): A plugin for adding authorization checks
throughout your schema
- [`@giraphql/plugin-relay`](relay.md): A plugin for adding builder methods for defining relay style
nodes and connections, and some helpful utilities for cursor based pagination
- [`@giraphql/plugin-smart-subscriptions`](smart-subscriptions.md): A plugin for a more graph
friendly way of defining subscriptions.
- [`@giraphql/plugin-simple-objects`](simple-objects.md): A plugin for creating simple objects and
interfaces without resolvers or arguments.
- [`@giraphql/plugin-mocks`](mocks.md): A plugin for mocking out resolvers in your schema.
- [`@giraphql/plugin-sub-graph`](sub-graph.md): A plugin for creating sub selections of your graph.
- [`@giraphql/plugin-directives`](directives.md): A plugin for using directives with GiraphQL
schemas.
- [`@giraphql/plugin-validation`](validation.md): A plugin for validating arguments.
- ## [Scope Auth](./scope-auth.md)
Add global, type level, or field level authorization checks to your schema
- ## [Validation](./validation.md)
Validating your inputs and arguments
- ## [Dataloader](./dataloader.md)
Quickly define data-loaders for your types and fields to avoid n+1 queries.
- ## [Relay](./relay.md)
- Easy to use builder methods for defining relay style nodes and connections, and helpful utilities
for cursor based pagination.
- ## [Simple Objects](./simple-objects.md)
Define simple object types without resolvers or manual type definitions.
- ## [Mocks](./mocks.md)
Add mock resolver for easier testing
- ## [Sub-Graph](./sub-graph.md)
Build multiple subsets of your graph to easily share code between internal and external APIs.
- ## [Directives](./directives.md)
Integrate with existing schema graphql directives in a type-safe way.
- ## [Smart Subscriptions](./smart-subscriptions.md)
Make any part of your graph subscribable to get live updates as your data changes.
48 changes: 38 additions & 10 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# GiraphQL SchemaBuilder
## GiraphQL - A plugin based GraphQL schema builder for typescript

GiraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first
approach. The GiraphQL schema builder makes writing schemas easy by providing a simple clean API
with helpful auto-completes, and removing the need for compile steps or defining the same types in
multiple files.
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

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

const builder = new SchemaBuilder({});

Expand All @@ -22,11 +30,31 @@ builder.queryType({
}),
});

const server = new ApolloServer({
new ApolloServer({
schema: builder.toSchema({}),
});

server.listen(3000);
}).listen(3000);
```

## Plugins that make GiraphQL even better

- ## [Scope Auth](plugins/scope-auth.md)
Add global, type level, or field level authorization checks to your schema
- ## [Validation](plugins/validation.md)
Validating your inputs and arguments
- ## [Dataloader](plugins/dataloader.md)
Quickly define data-loaders for your types and fields to avoid n+1 queries.
- ## [Relay](plugins/relay.md)
- Easy to use builder methods for defining relay style nodes and connections, and helpful utilities
for cursor based pagination.
- ## [Simple Objects](plugins/simple-objects.md)
Define simple object types without resolvers or manual type definitions.
- ## [Mocks](plugins/mocks.md)
Add mock resolver for easier testing
- ## [Sub-Graph](plugins/sub-graph.md)
Build multiple subsets of your graph to easily share code between internal and external APIs.
- ## [Directives](plugins/directives.md)
Integrate with existing schema graphql directives in a type-safe way.
- ## [Smart Subscriptions](plugins/smart-subscriptions.md)
Make any part of your graph subscribable to get live updates as your data changes.

## Full docs available at https://giraphql.com

0 comments on commit 07c727b

Please sign in to comment.