Drop the client typedef for the manifest referrers connection

What does this MR do and why?

Fixes broken master: generate-apollo-graphql-schema fails on every pipeline with

Field "ArtifactRegistryManifestDetails.referrers" already exists in the schema. It cannot also be defined in this type extension.

The Apollo schema build loads the server SDL plus every client .graphql file under app/assets. Two MRs from the same feature series each declared referrers on ArtifactRegistryManifestDetails:

  • !256442 (merged) (merged 04:12 UTC) added a client extend type ArtifactRegistryManifestDetails { referrers(...) } in typedefs.graphql.
  • !255686 (merged) (merged 04:31 UTC) added the server field :referrers to manifest_details_type.rb.

Neither fails alone; no pipeline ever held both (the merge-train pipelines that gated the merges only run pre-merge-checks). Master broke on the merge commit of the second.

This MR removes the client half of the collision and nothing more:

  • Delete graphql/typedefs.graphql — the referrers extension was the only declaration left in it; a comments-only .graphql fails to parse.
  • Drop the typeDefs option in repositories/index.js.
  • In mock_resolvers_spec.js, register referrers under LOCALLY_ANSWERED_SCHEMA_FIELDS instead of deriving the allowed list from the typedef.

The field stays selected @client in get_manifest_referrers.query.graphql and answered by the mock resolver. That is the same treatment the schema-owned manifest field already gets on master (selected @client, no client typedef), and Apollo local resolvers do not need typeDefs to resolve @client fields, so the flagged page (artifact_registry_ui, default off) behaves exactly as before. The full local-layer teardown stays with its own plan step.

Verification

Reproduced the job's schema merge locally with graphql-js (buildSchema on the dumped SDL, then extendSchema with every type definition found in {ee/,jh/,}app/assets/javascripts/**/*.graphql): fails with the exact CI error on master, passes on this branch. ee/spec/frontend/packages_and_registries/artifact_registry/graphql/ passes (7 suites, 222 tests).

References

Screenshots or screen recordings

No UI change: the manifest detail page reads the same @client fields through the same mock resolver before and after.

How to set up and validate locally

  1. bundle exec rake gitlab:graphql:schema:dump
  2. On master, apollo client:download-schema --config=config/apollo.config.js tmp/out.graphql fails with the error above; on this branch it succeeds.
  3. yarn jest ee/spec/frontend/packages_and_registries/artifact_registry/graphql/

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading