Skip to content
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

Viewer fix for statuses #2593

Merged
merged 3 commits into from
Aug 7, 2020
Merged

Viewer fix for statuses #2593

merged 3 commits into from
Aug 7, 2020

Conversation

pvinis
Copy link
Contributor

@pvinis pvinis commented Aug 7, 2020

This PR adds the statuses field in the viewer we created for force for viewingRooms

I tried adding a test for inputFields include statuses, but I couldn't add this in an easy way.

I tried getting it by using something like getFieldsForTypeFromSchema but for inputFields, but there is no "type" that these are attached to.

I did find and try this which worked and gave me the whole schema basically. I'm sure we could use this in a test and get everything and them map it in an object that we can ask like Viewer.viewingRoomsConnection.inputFields includes statuses.

Copy link
Contributor

@mdole mdole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! let's get this merged :)

@@ -137,7 +137,7 @@ export const gravityStitchingEnvironment = (
}

extend type Viewer {
viewingRoomsConnection(first: Int, after: String): ViewingRoomConnection
viewingRoomsConnection(first: Int, after: String, statuses: [ViewingRoomStatusEnum!]): ViewingRoomConnection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to make sure I understood the syntax of [ViewingRoomStatusEnum!]; i.e. what exactly can be null, and found this handy reference: https://graphql-ruby.org/type_definitions/lists.html#nullable-lists-with-non-null-items

TL;DR we can pass nil for statuses, but if a list is present, it has to include value(s) of type ViewingRoomStatusEnum. Sounds right to me!

@mdole mdole merged commit 2b546dc into master Aug 7, 2020
@artsy-peril artsy-peril bot mentioned this pull request Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants