GraphQL Introspection is a built-in feature that allows clients to query the schema itself, revealing all types, fields, queries, mutations, and their arguments. While useful for development, exposed introspection in production can aid attackers in reconnaissance.
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
name
fields {
name
args {
name
type { name }
}
type { name }
}
}
}
}
# Example introspection response reveals:
{
"data": {
"__schema": {
"types": [
{
"name": "User",
"fields": [
{"name": "id"},
{"name": "email"},
{"name": "password"}, # Sensitive!
{"name": "isAdmin"}, # Auth field
{"name": "internalNotes"} # Private data
]
},
{
"name": "Mutation",
"fields": [
{"name": "deleteUser"}, # Admin function
{"name": "updatePermissions"} # Privilege escalation
]
}
]
}
}
}