Skip to content

Geo Generalization - GraphQL Query

Zack Cuddy requested to merge 219402-geo-generic-graphql into master

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:

Screen_Shot_2020-07-01_at_2.09.22_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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)

Edited by Zack Cuddy

Merge request reports

Loading