https://github.com/suessflorian/gqlfetch
Generates a graphql server schema using introspection.
https://github.com/suessflorian/gqlfetch
go graphql introspection-query
Last synced: 5 months ago
JSON representation
Generates a graphql server schema using introspection.
- Host: GitHub
- URL: https://github.com/suessflorian/gqlfetch
- Owner: suessflorian
- License: mit
- Created: 2021-10-14T09:06:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-20T14:01:49.000Z (about 1 year ago)
- Last Synced: 2026-01-13T00:51:59.284Z (6 months ago)
- Topics: go, graphql, introspection-query
- Language: Go
- Homepage:
- Size: 46.9 KB
- Stars: 20
- Watchers: 1
- Forks: 13
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GQLFetch
GraphQL introspection based schema generator, introspection query document mirrors the [graphql-js](https://github.com/graphql/graphql-js) `getIntrospectionQuery` document albeit compliant to the [June 2018 specification](https://spec.graphql.org/June2018/#sec-Introspection).
## Usage
```go
import (
"github.com/suessflorian/gqlfetch"
)
func main() {
schema, _ := gqlfetch.BuildClientSchema(ctx, endpoint)
}
```
### Or use as cli tool
Introduced a directory here `/gqlfetch` which will create a `gqlfetch` cli tool.
```bash
go install github.com/suessflorian/gqlfetch/gqlfetch
# gqlfetch --help
gqlfetch --endpoint "localhost:8080/query" > schema.graphql
```
If you get an error claiming that `gqlfetch` cannot be found or is not defined, you may need to add `~/go/bin` to your `$PATH` (MacOS/Linux), or `%HOME%\go\bin` (Windows).
## Roadmap
Hoping to incorporate this into a graphql utility package like [gqlparser](https://github.com/vektah/gqlparser), enable introspection based type-safe graphql client generation in [genqlient](https://github.com/Khan/genqlient) and simplify the `Service` type federated services need to expose to a [bramble](https://movio.github.io/bramble/#/federation) gateway (improving the schema gathering logic).
## Notice
Project not fully mature yet, if you find any issues, please submit an issue.