-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getChangeHistory #805
Fix getChangeHistory #805
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e56c407
to
eda4526
Compare
eda4526
to
db8b112
Compare
db8b112
to
472e6f9
Compare
472e6f9
to
99ec881
Compare
@@ -51,7 +52,7 @@ const ChangesetRow = ({ changeset }: ChangsetRowProps): JSX.Element => { | |||
} | |||
|
|||
const ClimbChange = ({ changeId, fullDocument, updateDescription, dbOp }: ChangeType): JSX.Element | null => { | |||
if ((fullDocument as ClimbType)?.name == null) { | |||
if (fullDocument.__typeName !== DocumentTypeName.Climb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More robust to use __typename
than unique document fields: https://www.apollographql.com/docs/apollo-server/schema/unions-interfaces/#querying-a-union
Note that builds will keep failing until newest openbeta-graphql changes are deployed to staging. Otherwise during build, we prepare static props which requires calling the staging API and that fails because the old code doesn't expect Organization document changes. |
In response to breakage reported here: #782.
In working on this, I considered whether we should be showing Organizations history in the general changelog. I feel it could go either way:
In the end, I figured we can just expand functionality to show a change (including those for organizations) if it exists. If we want to remove organization changes, the best place is probably at the GraphQL query layer, by adding a filter.
The current filter doesn't support
kind
. The problem is that a changelog of a certain kind can involve documents of multiple kinds. Eg. add climb (changelogkind
== 'climbs') involves inserting a climb (documentkind
== 'climbs') and updating the parent area (documentkind
= 'areas'). It's not clear whether we should include the parent area document change when filtering for climbing changelogs. So there's some nuance here to think about.For context,
kind
is stabilized on the backend in this OpenBeta/openbeta-graphql#277.