graphql-hive / graphql-hive/console

Rethink usage tracking of union members for Hive App UI

Open
#3,817 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
483
Forks
145
Avg merge
2d 5h
Merged PRs (30d)
65

Description

Union type field usage is shown as 1.8k times.
Clicking on the same field in explorer, shows zero usage

We don’t track members of a union directly, we track types and fields of these members.
Let’s say you have `Query.media` that resolves Media union, that has `TV` and `Radio` members.
When querying `Query.media`, for Hive does not matter if it’s a union or an interface as you use fragments there anyway.
These fragments (spreads or inlines) tell Hive what you are querying there.

When querying `.__typename`, we do mark the union as used though. This way we “lock” the union type, so whenever you modify its members, we treat it as a breaking change.
It’s not ideal, but it’s only affecting the UI part of Hive.

We will double-think if tracking the names of union members makes sense and won’t cause damage.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.