@@ -34,90 +34,90 @@ class Query {
34
34
/// the query will return resources where [attribute] is equal
35
35
/// to any of the values in the list.
36
36
static String equal(String attribute, dynamic value) =>
37
- Query._('equal', attribute, value).toJson ();
37
+ Query._('equal', attribute, value).toString ();
38
38
39
39
/// Filter resources where [attribute] is not equal to [value].
40
40
static String notEqual(String attribute, dynamic value) =>
41
- Query._('notEqual', attribute, [value]).toJson ();
41
+ Query._('notEqual', attribute, [value]).toString ();
42
42
43
43
/// Filter resources where [attribute] is less than [value].
44
44
static String lessThan(String attribute, dynamic value) =>
45
- Query._('lessThan', attribute, value).toJson ();
45
+ Query._('lessThan', attribute, value).toString ();
46
46
47
47
/// Filter resources where [attribute] is less than or equal to [value].
48
48
static String lessThanEqual(String attribute, dynamic value) =>
49
- Query._('lessThanEqual', attribute, value).toJson ();
49
+ Query._('lessThanEqual', attribute, value).toString ();
50
50
51
51
/// Filter resources where [attribute] is greater than [value].
52
52
static String greaterThan(String attribute, dynamic value) =>
53
- Query._('greaterThan', attribute, value).toJson ();
53
+ Query._('greaterThan', attribute, value).toString ();
54
54
55
55
/// Filter resources where [attribute] is greater than or equal to [value].
56
56
static String greaterThanEqual(String attribute, dynamic value) =>
57
- Query._('greaterThanEqual', attribute, value).toJson ();
57
+ Query._('greaterThanEqual', attribute, value).toString ();
58
58
59
59
/// Filter resources where by searching [attribute] for [value].
60
60
static String search(String attribute, String value) =>
61
- Query._('search', attribute, value).toJson ();
61
+ Query._('search', attribute, value).toString ();
62
62
63
63
/// Filter resources where [attribute] is null.
64
- static String isNull(String attribute) => Query._('isNull', attribute).toJson ();
64
+ static String isNull(String attribute) => Query._('isNull', attribute).toString ();
65
65
66
66
/// Filter resources where [attribute] is not null.
67
- static String isNotNull(String attribute) => Query._('isNotNull', attribute).toJson ();
67
+ static String isNotNull(String attribute) => Query._('isNotNull', attribute).toString ();
68
68
69
69
/// Filter resources where [attribute] is between [start] and [end] (inclusive).
70
70
static String between(String attribute, dynamic start, dynamic end) =>
71
- Query._('between', attribute, [start, end]).toJson ();
71
+ Query._('between', attribute, [start, end]).toString ();
72
72
73
73
/// Filter resources where [attribute] starts with [value].
74
74
static String startsWith(String attribute, String value) =>
75
- Query._('startsWith', attribute, value).toJson ();
75
+ Query._('startsWith', attribute, value).toString ();
76
76
77
77
/// Filter resources where [attribute] ends with [value].
78
78
static String endsWith(String attribute, String value) =>
79
- Query._('endsWith', attribute, value).toJson ();
79
+ Query._('endsWith', attribute, value).toString ();
80
80
81
81
/// Filter resources where [attribute] contains [value]
82
82
/// [value] can be a single value or a list.
83
83
static String contains(String attribute, dynamic value) =>
84
- Query._('contains', attribute, value).toJson ();
84
+ Query._('contains', attribute, value).toString ();
85
85
86
86
static String or(List<String > queries) =>
87
- Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toJson ();
87
+ Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toString ();
88
88
89
89
static String and(List<String > queries) =>
90
- Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toJson ();
90
+ Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toString ();
91
91
92
92
/// Specify which attributes should be returned by the API call.
93
93
static String select(List<String > attributes) =>
94
- Query._('select', null, attributes).toJson ();
94
+ Query._('select', null, attributes).toString ();
95
95
96
96
/// Sort results by [attribute] ascending.
97
- static String orderAsc(String attribute) => Query._('orderAsc', attribute).toJson ();
97
+ static String orderAsc(String attribute) => Query._('orderAsc', attribute).toString ();
98
98
99
99
/// Sort results by [attribute] descending.
100
- static String orderDesc(String attribute) => Query._('orderDesc', attribute).toJson ();
100
+ static String orderDesc(String attribute) => Query._('orderDesc', attribute).toString ();
101
101
102
102
/// Return results before [id].
103
103
///
104
104
/// Refer to the [Cursor Based Pagination]({{sdk .url }}/docs/pagination#cursor-pagination)
105
105
/// docs for more information.
106
- static String cursorBefore(String id) => Query._('cursorBefore', null, id).toJson ();
106
+ static String cursorBefore(String id) => Query._('cursorBefore', null, id).toString ();
107
107
108
108
/// Return results after [id].
109
109
///
110
110
/// Refer to the [Cursor Based Pagination]({{sdk .url }}/docs/pagination#cursor-pagination)
111
111
/// docs for more information.
112
- static String cursorAfter(String id) => Query._('cursorAfter', null, id).toJson ();
112
+ static String cursorAfter(String id) => Query._('cursorAfter', null, id).toString ();
113
113
114
114
/// Return only [limit] results.
115
- static String limit(int limit) => Query._('limit', null, limit).toJson ();
115
+ static String limit(int limit) => Query._('limit', null, limit).toString ();
116
116
117
117
/// Return results from [offset].
118
118
///
119
119
/// Refer to the [Offset Pagination]({{sdk .url }}/docs/pagination#offset-pagination)
120
120
/// docs for more information.
121
- static String offset(int offset) => Query._('offset', null, offset).toJson ();
121
+ static String offset(int offset) => Query._('offset', null, offset).toString ();
122
122
123
123
}
0 commit comments