Skip to content

Commit a0cd417

Browse files
committed
refactors to change name to identifier
1 parent 4726106 commit a0cd417

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

force-app/main/default/classes/GraphQLNode.cls

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
public class GraphQLNode {
2-
public String name;
3-
public Boolean typeFrament; // transforms to "...on {NAME} {"
2+
public String id;
3+
public Boolean typeFrament; // transforms to "...on {id} {"
44
public GraphQLArgument arg; //not sure this supports all use cases... might need to be GraphQLArgument | GraphQLArgument[]
55
public Object[] children; //object or other nodes
66

7-
public GraphQLNode(String name){
7+
public GraphQLNode(String id){
88
this.typeFrament = false;
99
this.children = new Object[]{};
10-
this.name = name;
10+
this.id = id;
11+
}
12+
13+
//returns the current node
14+
public GraphQLNode setId(String id){
15+
this.id = id;
16+
return this;
1117
}
1218

1319
//returns the current node
@@ -32,9 +38,9 @@ public class GraphQLNode {
3238
}
3339

3440
private string buildInner(){
35-
String qry = this.name;
41+
String qry = this.id;
3642
if(this.typeFrament){
37-
qry = '... on ' + this.name;
43+
qry = '... on ' + this.id;
3844
}
3945

4046
if(this.arg != null){

0 commit comments

Comments
 (0)