Great to see the new GraphQL support! Can you please document what features it has in addition to simply sending an HTTP request and parsing the JSON response? One seems to be support for variables, though this is not explicitly documented and the sample is broken.
Is it possible to sort and filter on the server side using a GraphQL endpoint?
How can pagination be done?
I tried setting sort: 'server' or a content: 'serverFilter' header on columns, but Webix kept sending the same GraphQL query to the server (unsurprisingly, because there is no documentation on how to bind sort column ids or filter values to query parameters).
Basically, the GraphQL proxy helps sending GraphQL queries and translates the response into normal JSON that can be consumed by Webix widgets.
The support for variables is mentioned, but maybe we need to make it more explicit. And sorry for the sample, we fill fix it shortly.
As to additional parameters that enable server-side paging, sorting and filtering: proxy calls do not handle these parameters and one needs to modify the proxy to append them to the query string/object manually. The solution is described in the following discussion.
I admit we need to put in somewhere in the guides as it’s a kind of a frequently asked question. Thank you for reminding.
Thanks Helga, that link to variables actually shows that the outgoing query looks like as Webix sends it to the endpoint. How to pass variables to queries could only be guessed from the “loading data” example under Initialization and from the save example. This is confusing though - the documentation for ui.datatable.load states that the first parameter is a string, the URL. But the “loading data” example I mentioned above passes an object as the only parameter to .load(). So how do we pass variables when (re)loading data for a DataTable? Or is the documentation for ui.datatable.load incomplete, as it is for the .url property?
A clear section on query variables and tips on how to connect them bidirectionally (save/load) with a UI widget would be great. For example, a sample showing how to do server-side sorting by reloading data in a DataTable after the user clicks on a header.
Should this be done by extending webix.proxy.GraphQL and redefining the .load method? (In that case, what method should be called at the end of the load function, corresponding to webix.ajax from the proxy example you gave?
Or by using a dataprocessor?
Or by calling .load on the DataTable object (and somehow passing variables)?