Skip to content

Latest commit

 

History

History
786 lines (612 loc) · 17.9 KB

schema.md

File metadata and controls

786 lines (612 loc) · 17.9 KB

Schema Types

Table of Contents

Query

Field Argument Type Description
page Document
url String

A URL to fetch the HTML source from.

source String

A string containing HTML to be used as the source document.

Objects

Document

A DOM document.

Field Argument Type Description
content String

The HTML content of the subnodes

selector String

A CSS selector.

html String

The HTML content of the selected DOM node

selector String

A CSS selector.

text String

The text content of the selected DOM node

selector String

A CSS selector.

tag String

The tag name of the selected DOM node

selector String

A CSS selector.

attr String

An attribute of the selected node (eg. href, src, etc.).

selector String

A CSS selector.

name String!

The name of the attribute

has Boolean

Returns true if an element with the given selector exists.

selector String

A CSS selector.

query Element

Equivalent to Element.querySelector. The selectors of any nested queries will be scoped to the resulting element.

selector String

A CSS selector.

queryAll [Element]

Equivalent to Element.querySelectorAll. The selectors of any nested queries will be scoped to the resulting elements.

selector String

A CSS selector.

children [Element]

An element's child elements.

parent Element

An element's parent element.

siblings [Element]

All elements which are at the same level in the tree as the current element, ie. the children of the current element's parent. Includes the current element.

next Element

The current element's next sibling. Includes text nodes. Equivalent to Node.nextSibling.

nextAll [Element]

All of the current element's next siblings

previous Element

The current element's previous sibling. Includes text nodes. Equivalent to Node.previousSibling.

previousAll [Element]

All of the current element's previous siblings

title String

The page title

Element

A DOM element.

Field Argument Type Description
content String

The HTML content of the subnodes

selector String

A CSS selector.

html String

The HTML content of the selected DOM node

selector String

A CSS selector.

text String

The text content of the selected DOM node

selector String

A CSS selector.

tag String

The tag name of the selected DOM node

selector String

A CSS selector.

attr String

An attribute of the selected node (eg. href, src, etc.).

selector String

A CSS selector.

name String!

The name of the attribute

has Boolean

Returns true if an element with the given selector exists.

selector String

A CSS selector.

query Element

Equivalent to Element.querySelector. The selectors of any nested queries will be scoped to the resulting element.

selector String

A CSS selector.

queryAll [Element]

Equivalent to Element.querySelectorAll. The selectors of any nested queries will be scoped to the resulting elements.

selector String

A CSS selector.

children [Element]

An element's child elements.

parent Element

An element's parent element.

siblings [Element]

All elements which are at the same level in the tree as the current element, ie. the children of the current element's parent. Includes the current element.

next Element

The current element's next sibling. Includes text nodes. Equivalent to Node.nextSibling.

nextAll [Element]

All of the current element's next siblings

previous Element

The current element's previous sibling. Includes text nodes. Equivalent to Node.previousSibling.

previousAll [Element]

All of the current element's previous siblings

visit Document

If the element is a link, visit the page linked to in the href attribute.

Scalars

Boolean

The Boolean scalar type represents true or false.

String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Interfaces

Node

A DOM node (either an Element or a Document).

Field Argument Type Description
content String

The HTML content of the subnodes

selector String

A CSS selector.

html String

The HTML content of the selected DOM node

selector String

A CSS selector.

text String

The text content of the selected DOM node

selector String

A CSS selector.

tag String

The tag name of the selected DOM node

selector String

A CSS selector.

attr String

An attribute of the selected node (eg. href, src, etc.).

selector String

A CSS selector.

name String!

The name of the attribute

has Boolean

Returns true if an element with the given selector exists.

selector String

A CSS selector.

query Element

Equivalent to Element.querySelector. The selectors of any nested queries will be scoped to the resulting element.

selector String

A CSS selector.

queryAll [Element]

Equivalent to Element.querySelectorAll. The selectors of any nested queries will be scoped to the resulting elements.

selector String

A CSS selector.

children [Element]

An element's child elements.

parent Element

An element's parent element.

siblings [Element]

All elements which are at the same level in the tree as the current element, ie. the children of the current element's parent. Includes the current element.

next Element

The current element's next sibling. Includes text nodes. Equivalent to Node.nextSibling.

nextAll [Element]

All of the current element's next siblings

previous Element

The current element's previous sibling. Includes text nodes. Equivalent to Node.previousSibling.

previousAll [Element]

All of the current element's previous siblings