viewport
Sets the viewport dimensions for the browser session
Example:
mutation SetViewport {
viewport(width: 1920, height: 1080) {
width
height
time
}
}
Mobile device simulation:
mutation MobileViewport {
viewport(width: 375, height: 667, deviceScaleFactor: 1, mobile: true) {
width
height
deviceScaleFactor
mobile
time
}
}
Desktop simulation:
mutation DesktopViewport {
viewport(width: 1920, height: 1080, mobile: false) {
width
height
mobile
time
}
}
viewport(
width: Float!
height: Float!
deviceScaleFactor: Float = 1
mobile: Boolean = false
): ViewportResponse
Arguments
viewport.width
● Float!
non-null scalar
The width of the viewport in pixels
viewport.height
● Float!
non-null scalar
The height of the viewport in pixels
viewport.deviceScaleFactor
● Float
scalar
The device scale factor, defaults to 1
viewport.mobile
● Boolean
scalar
Whether to simulate a mobile device, defaults to false
Type
ViewportResponse
object
Response returned after setting the viewport