Skip to content

Commit

Permalink
Merge pull request #2593 from artsy/viewer-fix-for-statuses
Browse files Browse the repository at this point in the history
Viewer fix for statuses
  • Loading branch information
mdole authored Aug 7, 2020
2 parents bee9fd5 + c42f23a commit 2b546dc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
6 changes: 5 additions & 1 deletion _schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13749,7 +13749,11 @@ type Viewer {

# A list of Users
users(ids: [String]): [User]
viewingRoomsConnection(after: String, first: Int): ViewingRoomConnection
viewingRoomsConnection(
after: String
first: Int
statuses: [ViewingRoomStatusEnum!]
): ViewingRoomConnection
}

# An artwork viewing room
Expand Down
6 changes: 5 additions & 1 deletion _schemaV2.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9893,7 +9893,11 @@ type Viewer {
ids: [String]
last: Int
): UserConnection
viewingRoomsConnection(after: String, first: Int): ViewingRoomConnection
viewingRoomsConnection(
after: String
first: Int
statuses: [ViewingRoomStatusEnum!]
): ViewingRoomConnection
}

# An artwork viewing room
Expand Down
14 changes: 13 additions & 1 deletion src/lib/stitching/gravity/__tests__/stitching.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ describe("gravity/stitching", () => {
})
})

describe("#viewingRoomsConnection", () => {
describe("#viewingRoomsConnection in Partner", () => {
it("extends the Partner type with a viewingRoomsConnection field", async () => {
const mergedSchema = await getGravityMergedSchema()
const partnerFields = await getFieldsForTypeFromSchema(
Expand Down Expand Up @@ -487,6 +487,18 @@ describe("gravity/stitching", () => {
})
})

describe("#viewingRoomsConnection in Viewer", () => {
it("extends the Viewer type with a viewingRoomsConnection field", async () => {
const mergedSchema = await getGravityMergedSchema()
const viewerFields = await getFieldsForTypeFromSchema(
"Viewer",
mergedSchema
)

expect(viewerFields).toContain("viewingRoomsConnection")
})
})

describe("#artists", () => {
it("extends the ArtistSeries type with artists field", async () => {
const mergedSchema = await getGravityMergedSchema()
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stitching/gravity/stitching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const gravityStitchingEnvironment = (
}
extend type Viewer {
viewingRoomsConnection(first: Int, after: String): ViewingRoomConnection
viewingRoomsConnection(first: Int, after: String, statuses: [ViewingRoomStatusEnum!]): ViewingRoomConnection
}
`,
resolvers: {
Expand Down

0 comments on commit 2b546dc

Please sign in to comment.