@@ -17,25 +17,38 @@ public class GraphQLRequest {
17
17
@ JsonDeserialize (using = VariablesDeserializer .class )
18
18
private Map <String , Object > variables = new HashMap <>();
19
19
20
+ @ JsonDeserialize (using = ExtensionsDeserializer .class )
21
+ private Map <String , Object > extensions = new HashMap <>();
22
+
20
23
private String operationName ;
21
24
22
25
public GraphQLRequest () {}
23
26
24
- public GraphQLRequest (String query , Map <String , Object > variables , String operationName ) {
27
+ public GraphQLRequest (
28
+ String query ,
29
+ Map <String , Object > variables ,
30
+ Map <String , Object > extensions ,
31
+ String operationName ) {
25
32
this .query = query ;
26
33
this .operationName = operationName ;
34
+ if (extensions != null ) {
35
+ this .extensions = extensions ;
36
+ }
27
37
if (variables != null ) {
28
38
this .variables = variables ;
29
39
}
30
40
}
31
41
32
42
public static GraphQLRequest createIntrospectionRequest () {
33
43
return new GraphQLRequest (
34
- IntrospectionQuery .INTROSPECTION_QUERY , new HashMap <>(), "IntrospectionQuery" );
44
+ IntrospectionQuery .INTROSPECTION_QUERY ,
45
+ new HashMap <>(),
46
+ new HashMap <>(),
47
+ "IntrospectionQuery" );
35
48
}
36
49
37
50
public static GraphQLRequest createQueryOnlyRequest (String query ) {
38
- return new GraphQLRequest (query , new HashMap <>(), null );
51
+ return new GraphQLRequest (query , new HashMap <>(), new HashMap <>(), null );
39
52
}
40
53
41
54
public String getQuery () {
@@ -56,6 +69,16 @@ public void setVariables(Map<String, Object> variables) {
56
69
}
57
70
}
58
71
72
+ public Map <String , Object > getExtensions () {
73
+ return extensions ;
74
+ }
75
+
76
+ public void setExtensions (Map <String , Object > extensions ) {
77
+ if (extensions != null ) {
78
+ this .extensions = extensions ;
79
+ }
80
+ }
81
+
59
82
public String getOperationName () {
60
83
return extractOperationName (query , operationName , null );
61
84
}
0 commit comments