Documentation
¶
Overview ¶
edgeql-go is a tool to generate go functions from edgeql queries.
When run in a Gel project directory or subdirectory an *_edgeql.go source file will be generated for each *.edgeql file. The generated go will have a query and queryJSON function with typed arguments and return value matching the query's arguments and result shape. For example if a directory contains a get_user.edgeql file, edgeql-go will create a get_user_edgeql.go file with a getUser(...) and getUserJSON(...) function.
Install ¶
For go 1.24 and above:
go get -tool github.com/geldata/gel-go/cmd/edgeql-go@latest
For go 1.23 and below:
go install github.com/geldata/gel-go/cmd/edgeql-go@latest
Usage ¶
Typically this process would be run using go generate. For go 1.24 and above:
//go:generate go tool edgeql-go -pubfuncs -pubtypes -mixedcaps -rawmessage
For go 1.23 and below:
//go:generate edgeql-go -pubfuncs -pubtypes -mixedcaps -rawmessage
For a complete list of options:
edgeql-go -help
Click to show internal directories.
Click to hide internal directories.