Geo Generalization - GraphQL Query
What does this MR do?
Closes #219402 (closed)
Currently in the UI we are hard-coding every .graphql
file with the replicable type. We needed a way to have a generic solution to querying any particular replicable type from our endpoints. It didn't appear initially possible to interpolate something in this way via GraphQL alone. However, after looking into Apollo's documentation it seemed that we could use JavaScript interpolation along with graphql-tag
.
This solutions creates a method that "builds" the query using graphql-tag
as well as interpolating the graphql-field-name
into the query via javascript.
graphql-tag
This package was currently a devDependency
that I needed to promote to an actual dependency
to support this approach.
~"technical debt"
This change hard codes graphql-field-name
for Package Files in the index.html.haml
. This will be replaced by a generic solution found here: !35445 (closed)
Screenshots
Query still works as designed:
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Closes #219402 (closed)