| 1 |
"""GraphQL Language |
| 2 |
|
| 3 |
The :mod:`graphql.language` package is responsible for parsing and operating on the |
| 4 |
GraphQL language. |
| 5 |
""" |
| 6 |
|
| 7 |
from .source import Source |
| 8 |
|
| 9 |
from .location import get_location, SourceLocation, FormattedSourceLocation |
| 10 |
|
| 11 |
from .print_location import print_location, print_source_location |
| 12 |
|
| 13 |
from .token_kind import TokenKind |
| 14 |
|
| 15 |
from .lexer import Lexer |
| 16 |
|
| 17 |
from .parser import ( |
| 18 |
parse, |
| 19 |
parse_type, |
| 20 |
parse_value, |
| 21 |
parse_const_value, |
| 22 |
parse_schema_coordinate, |
| 23 |
) |
| 24 |
|
| 25 |
from .printer import print_ast |
| 26 |
|
| 27 |
from .visitor import ( |
| 28 |
visit, |
| 29 |
Visitor, |
| 30 |
ParallelVisitor, |
| 31 |
VisitorAction, |
| 32 |
VisitorKeyMap, |
| 33 |
BREAK, |
| 34 |
SKIP, |
| 35 |
REMOVE, |
| 36 |
IDLE, |
| 37 |
) |
| 38 |
|
| 39 |
from .ast import ( |
| 40 |
Location, |
| 41 |
Token, |
| 42 |
Node, |
| 43 |
# Each kind of AST node |
| 44 |
NameNode, |
| 45 |
DocumentNode, |
| 46 |
DefinitionNode, |
| 47 |
ExecutableDefinitionNode, |
| 48 |
OperationDefinitionNode, |
| 49 |
OperationType, |
| 50 |
VariableDefinitionNode, |
| 51 |
VariableNode, |
| 52 |
SelectionSetNode, |
| 53 |
SelectionNode, |
| 54 |
FieldNode, |
| 55 |
ArgumentNode, |
| 56 |
ConstArgumentNode, |
| 57 |
FragmentSpreadNode, |
| 58 |
InlineFragmentNode, |
| 59 |
FragmentDefinitionNode, |
| 60 |
ValueNode, |
| 61 |
ConstValueNode, |
| 62 |
IntValueNode, |
| 63 |
FloatValueNode, |
| 64 |
StringValueNode, |
| 65 |
BooleanValueNode, |
| 66 |
NullValueNode, |
| 67 |
EnumValueNode, |
| 68 |
ListValueNode, |
| 69 |
ConstListValueNode, |
| 70 |
ObjectValueNode, |
| 71 |
ConstObjectValueNode, |
| 72 |
ObjectFieldNode, |
| 73 |
ConstObjectFieldNode, |
| 74 |
DirectiveNode, |
| 75 |
ConstDirectiveNode, |
| 76 |
TypeNode, |
| 77 |
NamedTypeNode, |
| 78 |
ListTypeNode, |
| 79 |
NonNullTypeNode, |
| 80 |
TypeSystemDefinitionNode, |
| 81 |
SchemaDefinitionNode, |
| 82 |
OperationTypeDefinitionNode, |
| 83 |
TypeDefinitionNode, |
| 84 |
ScalarTypeDefinitionNode, |
| 85 |
ObjectTypeDefinitionNode, |
| 86 |
FieldDefinitionNode, |
| 87 |
InputValueDefinitionNode, |
| 88 |
InterfaceTypeDefinitionNode, |
| 89 |
UnionTypeDefinitionNode, |
| 90 |
EnumTypeDefinitionNode, |
| 91 |
EnumValueDefinitionNode, |
| 92 |
InputObjectTypeDefinitionNode, |
| 93 |
DirectiveDefinitionNode, |
| 94 |
TypeSystemExtensionNode, |
| 95 |
SchemaExtensionNode, |
| 96 |
TypeExtensionNode, |
| 97 |
ScalarTypeExtensionNode, |
| 98 |
ObjectTypeExtensionNode, |
| 99 |
InterfaceTypeExtensionNode, |
| 100 |
UnionTypeExtensionNode, |
| 101 |
EnumTypeExtensionNode, |
| 102 |
InputObjectTypeExtensionNode, |
| 103 |
DirectiveExtensionNode, |
| 104 |
SchemaCoordinateNode, |
| 105 |
TypeCoordinateNode, |
| 106 |
MemberCoordinateNode, |
| 107 |
ArgumentCoordinateNode, |
| 108 |
DirectiveCoordinateNode, |
| 109 |
DirectiveArgumentCoordinateNode, |
| 110 |
) |
| 111 |
from .predicates import ( |
| 112 |
is_definition_node, |
| 113 |
is_executable_definition_node, |
| 114 |
is_selection_node, |
| 115 |
is_value_node, |
| 116 |
is_const_value_node, |
| 117 |
is_type_node, |
| 118 |
is_type_system_definition_node, |
| 119 |
is_type_definition_node, |
| 120 |
is_type_system_extension_node, |
| 121 |
is_type_extension_node, |
| 122 |
is_schema_coordinate_node, |
| 123 |
) |
| 124 |
from .directive_locations import DirectiveLocation |
| 125 |
|
| 126 |
__all__ = [ |
| 127 |
"get_location", |
| 128 |
"SourceLocation", |
| 129 |
"FormattedSourceLocation", |
| 130 |
"print_location", |
| 131 |
"print_source_location", |
| 132 |
"TokenKind", |
| 133 |
"Lexer", |
| 134 |
"parse", |
| 135 |
"parse_value", |
| 136 |
"parse_const_value", |
| 137 |
"parse_type", |
| 138 |
"parse_schema_coordinate", |
| 139 |
"print_ast", |
| 140 |
"Source", |
| 141 |
"visit", |
| 142 |
"Visitor", |
| 143 |
"ParallelVisitor", |
| 144 |
"VisitorAction", |
| 145 |
"VisitorKeyMap", |
| 146 |
"BREAK", |
| 147 |
"SKIP", |
| 148 |
"REMOVE", |
| 149 |
"IDLE", |
| 150 |
"Location", |
| 151 |
"Token", |
| 152 |
"DirectiveLocation", |
| 153 |
"Node", |
| 154 |
"NameNode", |
| 155 |
"DocumentNode", |
| 156 |
"DefinitionNode", |
| 157 |
"ExecutableDefinitionNode", |
| 158 |
"OperationDefinitionNode", |
| 159 |
"OperationType", |
| 160 |
"VariableDefinitionNode", |
| 161 |
"VariableNode", |
| 162 |
"SelectionSetNode", |
| 163 |
"SelectionNode", |
| 164 |
"FieldNode", |
| 165 |
"ArgumentNode", |
| 166 |
"ConstArgumentNode", |
| 167 |
"FragmentSpreadNode", |
| 168 |
"InlineFragmentNode", |
| 169 |
"FragmentDefinitionNode", |
| 170 |
"ValueNode", |
| 171 |
"ConstValueNode", |
| 172 |
"IntValueNode", |
| 173 |
"FloatValueNode", |
| 174 |
"StringValueNode", |
| 175 |
"BooleanValueNode", |
| 176 |
"NullValueNode", |
| 177 |
"EnumValueNode", |
| 178 |
"ListValueNode", |
| 179 |
"ConstListValueNode", |
| 180 |
"ObjectValueNode", |
| 181 |
"ConstObjectValueNode", |
| 182 |
"ObjectFieldNode", |
| 183 |
"ConstObjectFieldNode", |
| 184 |
"DirectiveNode", |
| 185 |
"ConstDirectiveNode", |
| 186 |
"TypeNode", |
| 187 |
"NamedTypeNode", |
| 188 |
"ListTypeNode", |
| 189 |
"NonNullTypeNode", |
| 190 |
"TypeSystemDefinitionNode", |
| 191 |
"SchemaDefinitionNode", |
| 192 |
"OperationTypeDefinitionNode", |
| 193 |
"TypeDefinitionNode", |
| 194 |
"ScalarTypeDefinitionNode", |
| 195 |
"ObjectTypeDefinitionNode", |
| 196 |
"FieldDefinitionNode", |
| 197 |
"InputValueDefinitionNode", |
| 198 |
"InterfaceTypeDefinitionNode", |
| 199 |
"UnionTypeDefinitionNode", |
| 200 |
"EnumTypeDefinitionNode", |
| 201 |
"EnumValueDefinitionNode", |
| 202 |
"InputObjectTypeDefinitionNode", |
| 203 |
"DirectiveDefinitionNode", |
| 204 |
"TypeSystemExtensionNode", |
| 205 |
"SchemaExtensionNode", |
| 206 |
"TypeExtensionNode", |
| 207 |
"ScalarTypeExtensionNode", |
| 208 |
"ObjectTypeExtensionNode", |
| 209 |
"InterfaceTypeExtensionNode", |
| 210 |
"UnionTypeExtensionNode", |
| 211 |
"EnumTypeExtensionNode", |
| 212 |
"InputObjectTypeExtensionNode", |
| 213 |
"DirectiveExtensionNode", |
| 214 |
"SchemaCoordinateNode", |
| 215 |
"TypeCoordinateNode", |
| 216 |
"MemberCoordinateNode", |
| 217 |
"ArgumentCoordinateNode", |
| 218 |
"DirectiveCoordinateNode", |
| 219 |
"DirectiveArgumentCoordinateNode", |
| 220 |
"is_definition_node", |
| 221 |
"is_executable_definition_node", |
| 222 |
"is_selection_node", |
| 223 |
"is_value_node", |
| 224 |
"is_const_value_node", |
| 225 |
"is_type_node", |
| 226 |
"is_type_system_definition_node", |
| 227 |
"is_type_definition_node", |
| 228 |
"is_type_system_extension_node", |
| 229 |
"is_type_extension_node", |
| 230 |
"is_schema_coordinate_node", |
| 231 |
] |