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

refactor: fixes some misalignments between stitched / unstitched viewing rooms #6278

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

nickskalkin
Copy link
Contributor

@nickskalkin nickskalkin commented Nov 27, 2024

Warning

I've included _schemaV2.graphql to this PR only to discuss the rest of differences between stitched / unstitched schemas

Made some fixes in order to make stitched / unstitched viewing room schemas look more alike.

@nickskalkin nickskalkin self-assigned this Nov 27, 2024
@@ -12,7 +12,7 @@ import config from "config"

const rootFieldsAllowList = ["agreement"].concat(
config.USE_UNSTITCHED_VIEWING_ROOM_SCHEMA
? []
? ["viewingRooms"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to remove this field completely (gravity PR), but seems like it is still used by some clients. Don't know by whom yet. Do I understand it right that it shouldn't be a problem to temporarily keep it here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. Seems like an easy enough field to add directly to MP w/o stitching, esp considering everything else already added! and then you can remove it from here too.

@nickskalkin nickskalkin force-pushed the nickskalkin/viewing-room-fixes branch 2 times, most recently from a8bcdc1 to 900e4cd Compare November 27, 2024 16:29
input CreateViewingRoomInput {
attributes: ViewingRoomAttributes

# Main text
body: String

# A unique identifier for the client performing the mutation.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

a bunch of changes like that - I've decided to not add "obvious" rails-generated descriptions, but I can do it if you think I should

clientMutationId: String

# End datetime
endAt: ISO8601DateTime
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I add GravityISO8601DateTime type? Similar to GravityARImage below

Copy link
Contributor

Choose a reason for hiding this comment

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

nah, clients probably are fine either way since it's just a string. These fields may not even be used directly by clients vs. the other time fields like distanceToClose.

@@ -15204,7 +15191,9 @@ type Partner implements Node {
vatNumber: String
viewingRoomsConnection(
after: String
before: String
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new "default" connection params - it won't be a breaking change, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding stuff not a breaking change!

@@ -22198,15 +22153,21 @@ type Viewer {
# Recaptcha token.
recaptchaToken: String!
): VerifyUser

# Find a viewing room by ID
viewingRoom(id: ID!): ViewingRoom
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe I should remove this field since it was not there before

Copy link
Member

Choose a reason for hiding this comment

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

Seems useful!

viewingRoomsConnection(
after: String
before: String
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above - hopefully not a breaking change

partnerID: ID
statuses: [ViewingRoomStatusEnum!]
statuses: [ViewingRoomStatusEnum!] = [live]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

need to fix this

type ViewingRoomsConnection {
# A list of edges.
edges: [ViewingRoomsEdge]

# A list of nodes.
nodes: [ViewingRoom]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

argh, really don't want to add noted right to ViewingRoomsConnection (without edges in the middle). Is there a guaranteed way to tell wether there are any clients which do viewingRoomsConnection.nodes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just via yarn relay on this new schema AFAIK

# A list of nodes.
nodes: [ViewingRoom]
pageCursors: PageCursors
pageCursors: PageCursors!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there was no ! before - breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

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

i dont think so! as long as the MP pagination resolvers dont generate any nulls (they shouldn't)


# Information to aid in pagination.
pageInfo: PageInfo!
totalCount: Int
totalPages: Int
Copy link
Contributor Author

Choose a reason for hiding this comment

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

couldn't find totalPages being used in Force / Eigen, hopefully we can delete this field?

Copy link
Contributor

Choose a reason for hiding this comment

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

yarn relay should reveal it

@nickskalkin nickskalkin marked this pull request as draft November 27, 2024 16:55
@@ -11,7 +11,7 @@ export const createViewingRoomMutation = mutationWithClientMutationId<
any,
ResolverContext
>({
name: "createViewingRoom",
name: "CreateViewingRoom",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, yup this is important!

mzikherman
mzikherman previously approved these changes Nov 27, 2024
Copy link
Contributor

@mzikherman mzikherman left a comment

Choose a reason for hiding this comment

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

Nice! The schema changes look like they don't have any breaking changes to clients, so you can even commit the schema changes anytime (or it's fine to wait on that until after the flag is being flipped).

This is an excellent piece of work, overall. Unstitching viewing rooms (and some weirdness w/ the images, all the mutations, 'subsections', and everything else) - as a no-op to clients - really really good!

@nickskalkin nickskalkin marked this pull request as ready for review December 2, 2024 08:52
@nickskalkin nickskalkin force-pushed the nickskalkin/viewing-room-fixes branch from 900e4cd to 13165f1 Compare December 2, 2024 08:53
@nickskalkin nickskalkin force-pushed the nickskalkin/viewing-room-fixes branch from 13165f1 to 1985a05 Compare December 2, 2024 09:11
@nickskalkin nickskalkin merged commit d13f5cf into main Dec 2, 2024
4 checks passed
@nickskalkin nickskalkin deleted the nickskalkin/viewing-room-fixes branch December 2, 2024 09:22
@artsy-peril artsy-peril bot mentioned this pull request Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants