Skip to content

Latest commit

 

History

History
63 lines (50 loc) · 1.57 KB

README.md

File metadata and controls

63 lines (50 loc) · 1.57 KB

go-graphql-scalars

A collection of GraphQL (gqlgen) Scalars with SQLBoiler's null support

Install

go get -u "github.com/nrfta/go-graphql-scalars"

Usage

# scalars.graphql

"The `Date` is a date in the format YYYY-MM-DD"
scalar Date

"The `DateTime` is a date in the format ISO 8601 format: `2006-01-02T15:04:05Z07:00`"
scalar DateTime
# gqlgen.yml

schema:
  - "./*.graphql"

models:
  # -- Start Scalars --
  String:
    model:
      - github.com/99designs/gqlgen/graphql.String
      - github.com/nrfta/go-graphql-scalars.NullString
  Boolean:
    model:
      - github.com/99designs/gqlgen/graphql.Boolean
      - github.com/nrfta/go-graphql-scalars.NullBoolean
  Float:
    model:
      - github.com/99designs/gqlgen/graphql.Float
      - github.com/nrfta/go-graphql-scalars.NullFloat64
  Int:
    model:
      - github.com/99designs/gqlgen/graphql.Int
      - github.com/99designs/gqlgen/graphql.Int32
      - github.com/99designs/gqlgen/graphql.Int64
      - github.com/nrfta/go-graphql-scalars.NullInt
  Date:
    model:
      - github.com/nrfta/go-graphql-scalars.Date
      - github.com/nrfta/go-graphql-scalars.NullDate
  DateTime:
    model:
      - github.com/nrfta/go-graphql-scalars.DateTime
      - github.com/nrfta/go-graphql-scalars.NullDateTime
  # -- End Scalars --

License

This project is licensed under the MIT License.