Skip to content

Instantly share code, notes, and snippets.

@nyancodeid
Created December 9, 2021 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nyancodeid/16e1ed47bfbd5410ccb8b04b4c57508c to your computer and use it in GitHub Desktop.
Save nyancodeid/16e1ed47bfbd5410ccb8b04b4c57508c to your computer and use it in GitHub Desktop.
DenoQL: GraphQL Schema
type Query {
page(
# A URL to fetch the HTML source from.
url: String
# A string containing HTML to be used as the source document.
source: String
): Document
}
# A DOM document.
type Document implements Node {
# The HTML content of the subnodes
content(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The HTML content of the selected DOM node
html(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The text content of the selected DOM node
text(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The tag name of the selected DOM node
tag(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An attribute of the selected node (eg. `href`, `src`, etc.).
attr(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
# The name of the attribute
name: String!
): String
# An href attribute of the selected node.
href(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
src(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
class(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
classList(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): [String]
# Returns true if an element with the given selector exists.
has(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Boolean
# The count of the selected DOM node
count(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Int
# Equivalent to [Element.querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector). The selectors of any nested queries will be scoped to the resulting element.
query(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Element
# Equivalent to [Element.querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll). The selectors of any nested queries will be scoped to the resulting elements.
queryAll(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): [Element]
# An element's child elements.
children: [Element]
# An element's child nodes. Includes text nodes.
childNodes: [Element]
# An element's parent element.
parent: 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.
siblings: [Element]
# The current element's next sibling. Includes text nodes. Equivalent to [Node.nextSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling).
next: Element
# All of the current element's next siblings
nextAll: [Element]
# The current element's previous sibling. Includes text nodes. Equivalent to [Node.previousSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling).
previous: Element
# All of the current element's previous siblings
previousAll: [Element]
# The page title
title: String
}
# A DOM node (either an Element or a Document).
interface Node {
# The HTML content of the subnodes
content(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The HTML content of the selected DOM node
html(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The text content of the selected DOM node
text(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The tag name of the selected DOM node
tag(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An attribute of the selected node (eg. `href`, `src`, etc.).
attr(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
# The name of the attribute
name: String!
): String
# An href attribute of the selected node.
href(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
src(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
class(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
classList(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): [String]
# Returns true if an element with the given selector exists.
has(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Boolean
# The count of the selected DOM node
count(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Int
# Equivalent to [Element.querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector). The selectors of any nested queries will be scoped to the resulting element.
query(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Element
# Equivalent to [Element.querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll). The selectors of any nested queries will be scoped to the resulting elements.
queryAll(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): [Element]
# An element's child elements.
children: [Element]
# An element's child nodes. Includes text nodes.
childNodes: [Element]
# An element's parent element.
parent: 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.
siblings: [Element]
# The current element's next sibling. Includes text nodes. Equivalent to [Node.nextSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling).
next: Element
# All of the current element's next siblings
nextAll: [Element]
# The current element's previous sibling. Includes text nodes. Equivalent to [Node.previousSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling).
previous: Element
# All of the current element's previous siblings
previousAll: [Element]
}
# A DOM element.
type Element implements Node {
# The HTML content of the subnodes
content(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The HTML content of the selected DOM node
html(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The text content of the selected DOM node
text(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# The tag name of the selected DOM node
tag(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An attribute of the selected node (eg. `href`, `src`, etc.).
attr(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
# The name of the attribute
name: String!
): String
# An href attribute of the selected node.
href(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
src(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
class(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): String
# An src attribute of the selected node.
classList(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): [String]
# Returns true if an element with the given selector exists.
has(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Boolean
# The count of the selected DOM node
count(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Int
# Equivalent to [Element.querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector). The selectors of any nested queries will be scoped to the resulting element.
query(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): Element
# Equivalent to [Element.querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll). The selectors of any nested queries will be scoped to the resulting elements.
queryAll(
# A [CSS selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Selectors).
selector: String
): [Element]
# An element's child elements.
children: [Element]
# An element's child nodes. Includes text nodes.
childNodes: [Element]
# An element's parent element.
parent: 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.
siblings: [Element]
# The current element's next sibling. Includes text nodes. Equivalent to [Node.nextSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling).
next: Element
# All of the current element's next siblings
nextAll: [Element]
# The current element's previous sibling. Includes text nodes. Equivalent to [Node.previousSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling).
previous: Element
# All of the current element's previous siblings
previousAll: [Element]
# If the element is a link, visit the page linked to in the href attribute.
visit: Document
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment