Explore the schema
Get all available types, explore a specific type (likeLesson), and more:
<!-- Get all available types -->
query {
__schema {
types {
name
kind
description
}
}
}
<!-- Explore a specific type (e.g., Lesson)
query {
__type(name: "Lesson") {
name
fields {
name
type {
name
kind
}
description
}
}
}
<!-- Get all available queries -->
query {
__schema {
queryType {
fields {
name
args {
name
type {
name
}
}
}
}
}
}
<!-- Get all relationship fields on a type -->
query {
__type(name: "Lesson") {
fields {
name
type {
name
ofType {
name
}
}
}
}
}
# Get all available types
curl -X POST \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{"query":"{ __schema { types { name kind } } }"}' \
https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql
# Explore a specific type (e.g., Lesson)
curl -X POST \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{"query":"{ __type(name: \"Lesson\") { fields { name type { name } } } }"}' \
https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql
from gql import Client, gql
# Get all available types
schema_query = gql("""
query {
__schema {
types {
name
kind
fields {
name
type {
name
}
}
}
}
}
""")
result = client.execute(schema_query)
for type_info in result["__schema"]["types"]:
if not type_info["name"].startswith("__"): # Skip introspection types
print(f"Type: {type_info['name']} ({type_info['kind']})")