-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update GraphQL to better support Locations #784
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,9 +108,14 @@ class AlternateTitleType < Types::BaseObject | |
|
||
# Warning: related_place was supposed to be an array but was incorrectly a string in graphql for v1 | ||
class LocationType < Types::BaseObject | ||
field :geopoint, String, description: 'GeoPoint data for the location, if applicable' | ||
field :geopoint, String, deprecation_reason: 'Use `geoshape`' | ||
field :geoshape, String, description: 'GeoShape data for the location, if applicable' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may want to provide more details on what is in this field. I believe dataeng is consistently (we should confirm) using the BBOX option for the envelope as described here: If that turns out to be true, noting something like this for description would probably be helpful. |
||
field :kind, String, description: 'Type of location' | ||
field :value, String, description: 'Name of location' | ||
|
||
def geopoint | ||
@object['geoshape'] | ||
end | ||
end | ||
|
||
class HighlightType < Types::BaseObject | ||
|
Large diffs are not rendered by default.
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.
As we discussed on zoom, let's try to deprecate
geopoint
as a matter of best practice even though it is very unlikely anyone is using it.So the we'd mark the field as deprecated and suggest using the new field while still mapping the new field value to the old field so people still get what they asked for either way. See https://github.com/MITLibraries/timdex/blob/main/app/graphql/types/record_type.rb#L34-L36 for an example of how we have done that on other fields that got renamed.
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.
Sure thing - I've switched from a replacement to a deprecation for
geopoint
now. The test has been updated to include it as well. I see the deprecation announcement in the help docs, but don't see it in the actual API response, so I don't yet have a way to test for the deprecation itself.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.
I don't think we need an explicit test for the deprecation at this point. Manually confirm it is flagged as deprecated along with the tests that both fields return the expected data should be solid. I'll finish up the review on this now thanks!