refactor: remove resultPath from GraphQLRequest
This MR removes the resultPath
from the GraphQLRequest
interface. This is a result of a discussion in WebIDE: gitlab-web-ide!195 (comment 1418290264)
/**
* Address of the result within the returned object
* it uses the syntax of lodash _.get function
* https://lodash.com/docs/4.17.15#get
* When omitted, the full GraphQL response is returned.
*
* For example if the result is `{ a: [{b: "c"}]}`
* you can set resultPath to `a[0].b` to retrieve only "c"
*/
resultPath?: string;
To simplify the interface, we removed the ability to "drill down" into the result object.
This means that we have to refactor the API calls:
- removing
resultPath: 'project'
changes all invocations- before
const gqlProject = ...
- after
const { project } = ...
- before
- removing
resultPath:
projects.nodes`` changes all invocations-
before
const projects = ...
-
after
const result = ... const projects = result.projects.nodes;
-
I want to reintroduce the resultPath
in the near future, but now I don't have a clear idea how to reconcile that GrapQLRequest
in WebIDE won't support it and GraphQLRequest
on the desktop will. Probably we'd create some proxy between WebIDE and our code that would add this feature.
Edited by Tomas Vik