# @anchan828/gen-graphql-relay-schema

> Auto generation for relay type

Latest version **0.7.68** (published 2023-04-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @anchan828/gen-graphql-relay-schema
pnpm add @anchan828/gen-graphql-relay-schema
yarn add @anchan828/gen-graphql-relay-schema
bun add @anchan828/gen-graphql-relay-schema
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.68 |
| Published | 2023-04-16 |
| First published | 2019-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 46.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | anchan828 |
| Maintainers | anchan828 |

## Links

- npm: https://www.npmjs.com/package/@anchan828/gen-graphql-relay-schema
- Repository: https://github.com/anchan828/gen-graphql-schema
- Homepage: https://github.com/anchan828/gen-graphql-schema/tree/master/packages/relay-schema#readme
- Issues: https://github.com/anchan828/gen-graphql-schema/issues
- npm.io page: https://npm.io/package/@anchan828/gen-graphql-relay-schema

## Dependencies (4)

- [deepmerge](https://npm.io/package/deepmerge.md) ^4.3.1
- [graphql-relay](https://npm.io/package/graphql-relay.md) ^0.10.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@anchan828/gen-graphql-schema-common](https://npm.io/package/@anchan828/gen-graphql-schema-common.md) ^0.7.68

## Recent versions

- 0.7.68 (latest) — 2023-04-16
- 0.7.67 — 2023-04-09
- 0.7.66 — 2023-04-02
- 0.7.65 — 2023-03-26
- 0.7.64 — 2023-03-19
- 0.7.63 — 2023-03-12
- 0.7.62 — 2023-03-05
- 0.7.61 — 2023-02-26
- 0.7.60 — 2023-02-19
- 0.7.59 — 2023-02-12
- 0.7.58 — 2023-02-05
- 0.7.57 — 2023-01-29
- 0.7.56 — 2023-01-22
- 0.7.55 — 2023-01-15
- 0.7.54 — 2023-01-08
- … 158 more at https://npm.io/package/@anchan828/gen-graphql-relay-schema/versions

## README

# @anchan828/gen-graphql-relay-schema

## Description

Auto generation for relay type

## Quick Start

```ts
import { genRelayTypes } from "@anchan828/gen-graphql-relay-schema";
import { buildASTSchema, printSchema } from "graphql";

const schema = `

type Project {
    id: ID
}

type Query {
    projects: [Project] @relay
}

`;

printSchema(buildASTSchema(genRelayTypes(schema)));
//=>  """A connection for relay"""
//    interface Connection {
//      """Identifies the total count of items in the connection."""
//      totalCount: Int
//
//      """Information to aid in pagination."""
//      pageInfo: PageInfo!
//
//      """A list of edges."""
//      edges: [Edge]
//    }
//
//    """An edge in a connection."""
//    interface Edge {
//      """A cursor for use in pagination."""
//      cursor: String
//    }
//
//    """An object with an ID."""
//    interface Node {
//      """ID of the object."""
//      id: ID!
//    }
//
//    """Information about pagination in a connection."""
//    type PageInfo {
//      """When paginating backwards, the cursor to continue."""
//      startCursor: String
//
//      """When paginating forwards, the cursor to continue."""
//      endCursor: String
//
//      """When paginating forwards, are there more items?"""
//      hasNextPage: Boolean
//
//      """When paginating backwards, are there more items?"""
//      hasPreviousPage: Boolean
//    }
//
//    type Project implements Node {
//      id: ID
//    }
//
//    """The connection type for Project"""
//    type ProjectConnection implements Connection {
//      """Identifies the total count of Project items in the connection."""
//      totalCount: Int
//
//      """A list of ProjectEdge."""
//      edges: [ProjectEdge]
//
//      """Information to aid in pagination."""
//      pageInfo: PageInfo!
//    }
//
//    """An edge in a ProjectConnection."""
//    type ProjectEdge implements Edge {
//      """The item at the end of the edge."""
//      node: Project
//
//      """A cursor for use in pagination."""
//      cursor: String
//    }
//
//    type Query {
//      projects(before: String, after: String, first: Int, last: Int): ProjectConnection
//    }
```

## License

[MIT](LICENSE).

---
_Source: https://npm.io/package/@anchan828/gen-graphql-relay-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
