get GraphQl schema through Curl

Cli

Get graphql schema through curl

1
2
3
4
5
curl 'https://gitlab.com/api/graphql' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-binary '{"query":"# Write your query or mutation here\nquery {\n __schema {\n mutationType {\n fields {\n name\n }\n }\n queryType {\n fields {\n name\n }\n }\n\t\ttypes{\n name\n }\n directives{\n name\n }\n }\n}"}' \
| jq

GraphQL query

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
query {
__schema {
mutationType {
fields {
name
}
}
queryType {
fields {
name
}
}
types{
name
}
directives{
name
}
}
}

https://gitlab.com/-/graphql-explorer