Categorygithub.com/ubgo/gqlmodel
modulepackage
0.0.4
Repository: https://github.com/ubgo/gqlmodel.git
Documentation: pkg.go.dev

# README

Gqlmodel GitHub license

Gqlmodel custom models for gqlgen.com grqphql module.

Installation

go get github.com/ubgo/gqlmodel

Note: If you are getting error modelgen: unable to find type github.com/ubgo/gqlmodel.UidScalar then create a new go file or use existing go file and add below code

import _ github.com/ubgo/gqlmodel

Models Support

  • uuid.UUID

How to Use

  1. Edit the gqlgen.yml file and add the code like this under models
Uid:
  model: github.com/ubgo/gqlmodel.UidScalar
  1. Under your schema.graphqls file add this scalar Uid
  2. Now you can use the UUID like this:
type Category {
  id: Uid!
  name: String!
}

You will see the model file generated as following:

type Category struct {
  ID   uuid.UUID `json:"id"`
  Name string    `json:"name"`
}

Contribute

If you would like to contribute to the project, please fork it and send us a pull request. Please add tests for any new features or bug fixes.

Stay in touch

License

goutil is MIT licensed.

# Functions

No description provided by the author
It will receive the value from the user and we can validate it before sending to the func This function will be execute only if type is defnied NON NULL i.e UID!.