Skip to content

Commit 2ef010f

Browse files
committed
Ruby: update GraphQL model
1 parent 61cda97 commit 2ef010f

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

ruby/ql/lib/codeql/ruby/frameworks/GraphQL.qll

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,8 @@ private API::Node graphQlSchema() { result = API::getTopLevelMember("GraphQL").g
3939
*/
4040
private class GraphqlRelayClassicMutationClass extends ClassDeclaration {
4141
GraphqlRelayClassicMutationClass() {
42-
this.getSuperclassExpr() =
43-
graphQlSchema()
44-
.getMember("RelayClassicMutation")
45-
.getASubclass()
46-
.getAValueReachableFromSource()
47-
.asExpr()
48-
.getExpr()
42+
this =
43+
graphQlSchema().getMember("RelayClassicMutation").getADescendentModule().getADeclaration()
4944
}
5045
}
5146

@@ -74,13 +69,7 @@ private class GraphqlRelayClassicMutationClass extends ClassDeclaration {
7469
*/
7570
private class GraphqlSchemaResolverClass extends ClassDeclaration {
7671
GraphqlSchemaResolverClass() {
77-
this.getSuperclassExpr() =
78-
graphQlSchema()
79-
.getMember("Resolver")
80-
.getASubclass()
81-
.getAValueReachableFromSource()
82-
.asExpr()
83-
.getExpr()
72+
this = graphQlSchema().getMember("Resolver").getADescendentModule().getADeclaration()
8473
}
8574
}
8675

@@ -103,13 +92,7 @@ private string getASupportedHttpMethod() { result = ["get", "post"] }
10392
*/
10493
class GraphqlSchemaObjectClass extends ClassDeclaration {
10594
GraphqlSchemaObjectClass() {
106-
this.getSuperclassExpr() =
107-
graphQlSchema()
108-
.getMember("Object")
109-
.getASubclass()
110-
.getAValueReachableFromSource()
111-
.asExpr()
112-
.getExpr()
95+
this = graphQlSchema().getMember("Object").getADescendentModule().getADeclaration()
11396
}
11497

11598
/** Gets a `GraphqlFieldDefinitionMethodCall` called in this class. */

0 commit comments

Comments
 (0)