Open nrathaus opened 8 months ago
Trying the OWASP one - https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/12-API_Testing/01-Testing_GraphQL:
query IntrospectionQuery {
__schema {
queryType {
name
}
mutationType {
name
}
subscriptionType {
name
}
types {
...FullType
}
directives {
name
description
locations
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type {
...TypeRef
}
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
Works as expected
I think the bug is here:
diff --git a/src/gqlspection/introspection_query.py b/src/gqlspection/introspection_query.py
index 601f7b0..9b9e467 100644
--- a/src/gqlspection/introspection_query.py
+++ b/src/gqlspection/introspection_query.py
@@ -10,7 +10,6 @@ query IntrospectionQuery {
queryType {
name
}
- }
# 'mutationType' can be null if there are no mutations.
mutationType {
name
The schema used in the function seems to be incorrect - there is an extra } at line 60 (of the query, not of the python file)