An open API service indexing awesome lists of open source software.

https://github.com/limit-zero/graphql-custom-types

Custom GraphQL Types, such as Date and Cursor
https://github.com/limit-zero/graphql-custom-types

graphql nodejs types

Last synced: 4 months ago
JSON representation

Custom GraphQL Types, such as Date and Cursor

Awesome Lists containing this project

README

          

# GraphQL Custom Data Types
Custom GraphQL Types, such as Date and Cursor

## Install
`yarn add @limit0/graphql-custom-types`

## Usage
Within your root resolver file, require the types and add them to the tree, similar to the following:
```js
const { DateType, CursorType } = require('@limit0/graphql-custom-types');

const resolvers = {
Date: DateType,
Cursor: CursorType,
};
```

Also, don't forget to add them to your GraphQL definitions:
```graphql
scalar Date
scalar Cursor
```