5 Answers
I found the schema is an artifact in the Gitlab CI pipe (graphql-schema-dump job), for example here: https://gitlab.com/gitlab-org/gitlab/-/jobs/1602029144.
Not perfect, but works.
It doesn’t look like GitLab shares the schema directly, just this Reference Documentation generated from the schema, and the GraphiQL Explorer / IDE (more info about GraphiQL Explorer here).
2
-
Yeah, which is really weird.. was hoping to use a rust lib (crates.io/crates/graphql_client) to avoid manually hacking the queries, but maybe I'll end up doing just that.
– Fredrik JanssonSep 16, 2021 at 19:25
-
Agreed. I didn't find any issues about it when searching, but they're pretty good about responding there if you want to open one.
– Adam MarshallSep 16, 2021 at 19:27
Here’s alternative, if you are working with Rust lang. For Rust developers, you need to install the crate named graphql_client_cli
via cargo. Example: cargo install graphql_client_cli
.
Next, you can run the graphql client you just downloaded, to get the schema (either in JSON or GraphQL format). Example: graphql-client --authorization 'Bearer <bearer token>' https://<your gitlab url site>/api/graphql
.
See the GraphQL Client CLI for more options.