@veriown/graphql-scalars
v1.3.0
Published
Scalars for some commonly used attributes.
Downloads
3
Keywords
Readme
Installation
npm install --save @veriown/graphql-scalars
Usage
- Import the types in your resolver-map.
const { DateTime, Date, Coordinates, Url, PhoneNumber, Email } = require('@veriown/graphql-scalars');
- Declare the types in your schema file
scalar Date
scalar DateTime
scalar Url
scalar Coordinates
scalar PhoneNumber
scalar Email
scalar RelativeUrl
scalar Uuid
- Use them like regular GraphQL types
type User {
id: ID!
name: String
address: String
houseCoordinates: Coordinates!
phone: PhoneNumber
website: [Url]
dob: Date
email: Email
}