lib/dashx/client.rb in dashx-0.5.0 vs lib/dashx/client.rb in dashx-0.6.0
- old
+ new
@@ -60,10 +60,24 @@
}
}
}
'
+ FETCH_STORED_PREFERENCES = 'query FetchStoredPreferences($input: FetchStoredPreferencesInput) {
+ fetchStoredPreferences(input: $input) {
+ preferenceData
+ }
+ }
+ '
+
+ SAVE_STORED_PREFERENCES = 'query SaveStoredPreferences($input: SaveStoredPreferencesInput) {
+ saveStoredPreferences(input: $input) {
+ success
+ }
+ }
+ '
+
def initialize(config)
@config = config
self.class.base_uri(config.base_uri)
@@ -130,9 +144,17 @@
make_graphql_request(SAVE_CONTACTS_REQUEST, { uid: uid, contacts: contacts })
end
def fetch_item(identifier)
make_graphql_request(FETCH_ITEM_REQUEST, { identifier: identifier })
+ end
+
+ def fetch_stored_preferences(uid)
+ make_graphql_request(FETCH_STORED_PREFERENCES, { accountUid: uid })
+ end
+
+ def save_stored_preferences(uid, preferenceData)
+ make_graphql_request(SAVE_STORED_PREFERENCES, { accountUid: uid, preferenceData: preferenceData })
end
private
def make_graphql_request(request, params)