Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graph_types

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graph_types

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GraphTypes

Build Status Gem Version

A Collection of Types for GraphQL.

Installation

Install from RubyGems by adding it to your Gemfile, then bundling.

# Gemfile
gem 'graph_types'
$ bundle install

Types:

DateTimeType

Declaration:

DummyType = GraphQL::ObjectType.define do
  name "Dummy"

  field :name,          !types.String
  field :createdAt,     !GraphTypes::DateTimeType, property: :created_at
end

Search:

birthday {
  formatted(strftime: "%Y-%m-%d")
}

Result:

"birthday": {
  "formatted": "2018-01-22"
}
MoneyType

Declaration:

DummyType = GraphQL::ObjectType.define do
  name "Dummy"

  field :name,          !types.String
  field :price,         !GraphTypes::MoneyType,    property: :price
end

Search:

amount {
  cents
  formatted(delimiter: ".", separator: ",", unit: "R$ ")
}

Result:

"amount": {
  "cents": 10000,
  "formatted": "R$ 100,00"
}      

Interfaces:

TimestampableInterface:

Declaration:

DummyType = GraphQL::ObjectType.define do
  name "Dummy"

  interfaces [TimestampableInterface]
end

Search:

dummy {
  createdAt {
    formatted(strftime: "%FT%T%Z")
  }
  updatedAt {
    formatted(strftime: "%FT%T%Z")
  }
}

Result:

"dummy": {
  "createdAt": "2018-01-11T17:36:07BRST",
  "updatedAt": "2018-01-11T17:36:07BRST"
}

FAQs

Package last updated on 22 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc