Skip to content

Coditation/gqlclientgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coditation

GraphQL Client/SDK Generator for Golang

A Golang client side code/SDK generator for consuming the GraphQL APIs.

How to use?

Build

go build gqlclientgen

Run

gqlclientgen -config_path=<path of the directory containing the config.yaml> -plugin_path=<path of the directory where all the plugin of custom scalars> -query_path=<path of the all operations with fragments>

Create Custom Scalar Plugin

The Custom Scalar Plugin should implement the methods:
    Type() string         // type of the custom scalar
	Code() *jen.Statement // code of dave/jennifer here 

    The File name of the custom scalar plugin i.e TimeStamp.go

For dave/jennifer code reference please refer here

This file should be built in a form of plugin using the following command
go build -buildmode=plugin TimeStamp.go TimeStamp.so

Config (YAML)

# Name of the package for generated client/SDK
packageName: "gql"
# Path of directory where generated code will be placed
outputDirectory: "/somedir"
# Default
sourceType: "file"
# Path of the graphql schema (IDL) file
sourceFilePath: "/somedir/schema.graphqls"
# URL of the graphql server with the introspection context
url: "gql"

Features

  • Golang model generation
  • Query
  • Mutations
  • Scalars - Map, Any, ID
  • Support for custom scalars
  • GraphQL directives
  • GraphQL fragments
  • Subscriptions
  • Load schema from URL

About

A Golang client side code/SDK generator for consuming the GraphQL APIs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages