morpheus-graphql-core-0.27.3: Morpheus GraphQL Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Morpheus.Types.SelectionTree

Description

 
Synopsis

Documentation

class SelectionTree node where Source #

The SelectionTree instance is a simple interface for interacting with morpheus's internal AST while keeping the ability to safely change the concrete representation of the AST.

Minimal complete definition

isLeaf, getName, getChildren, getChild, getArguments, getArgument

Associated Types

type ChildNode node :: Type Source #

Methods

isLeaf :: node -> Bool Source #

leaf test: is the list of children empty?

getName :: IsString name => node -> name Source #

get a node's name (real name. not alias)

getChildrenList :: node -> [ChildNode node] Source #

Get the children

getChildren :: node -> [ChildNode node] Source #

get the child nodes

getChild :: ToString name => name -> node -> Maybe (ChildNode node) Source #

lookup child node by name (does not use aliases)

hasChild :: ToString name => name -> node -> Bool Source #

checks if the node has a child with the specified name (does not use aliases)

getArguments :: IsString name => node -> [(name, Value)] Source #

get node arguments (as aeson values)

getArgument :: ToString name => name -> node -> Maybe Value Source #

get node argument by name (as aeson values)

Instances

Instances details
SelectionTree (Operation VALID) Source # 
Instance details

Defined in Data.Morpheus.Types.SelectionTree

Associated Types

type ChildNode (Operation VALID) Source #

SelectionTree (Selection VALID) Source # 
Instance details

Defined in Data.Morpheus.Types.SelectionTree

Associated Types

type ChildNode (Selection VALID) Source #