id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
6,070,601 | on_error | def on_error(error: GraphQLError) -> None:
if len(errors) >= max_errors: # type: ignore
errors.append(
GraphQLError(
"Too many validation errors, error limit reached."
" Validation aborted."
)
)
raise Va... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/validate.py | 67 | 76 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,602 | validate_sdl | def validate_sdl(
document_ast: DocumentNode,
schema_to_extend: Optional[GraphQLSchema] = None,
rules: Optional[Collection[Type[ASTValidationRule]]] = None,
) -> List[GraphQLError]:
"""Validate an SDL document.
For internal use only.
"""
errors: List[GraphQLError] = []
context = SDLVali... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/validate.py | 92 | 107 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,603 | assert_valid_sdl | def assert_valid_sdl(document_ast: DocumentNode) -> None:
"""Assert document is valid SDL.
Utility function which asserts a SDL document is valid by throwing an error if it
is invalid.
"""
errors = validate_sdl(document_ast)
if errors:
raise TypeError("\n\n".join(error.message for erro... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/validate.py | 110 | 119 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,604 | assert_valid_sdl_extension | def assert_valid_sdl_extension(
document_ast: DocumentNode, schema: GraphQLSchema
) -> None:
"""Assert document is a valid SDL extension.
Utility function which asserts a SDL document is valid by throwing an error if it
is invalid.
"""
errors = validate_sdl(document_ast, schema)
if errors:... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/validate.py | 122 | 133 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,605 | __init__ | def __init__(self, context: ASTValidationContext):
super().__init__(context)
self.known_operation_names: Dict[str, NameNode] = {} | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_operation_names.py | 18 | 20 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,606 | enter_operation_definition | def enter_operation_definition(
self, node: OperationDefinitionNode, *_args: Any
) -> VisitorAction:
operation_name = node.name
if operation_name:
known_operation_names = self.known_operation_names
if operation_name.value in known_operation_names:
self... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_operation_names.py | 22 | 38 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,607 | enter_fragment_definition | def enter_fragment_definition(*_args: Any) -> VisitorAction:
return SKIP | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_operation_names.py | 41 | 42 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,608 | __init__ | def __init__(self, context: SDLValidationContext):
super().__init__(context)
self.schema = context.schema
self.defined_types = {
def_.name.value: def_
for def_ in context.document.definitions
if isinstance(def_, TypeDefinitionNode)
} | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/possible_type_extensions.py | 27 | 34 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,609 | check_extension | def check_extension(self, node: TypeExtensionNode, *_args: Any) -> None:
schema = self.schema
type_name = node.name.value
def_node = self.defined_types.get(type_name)
existing_type = schema.get_type(type_name) if schema else None
expected_kind: Optional[str]
if def_node:... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/possible_type_extensions.py | 36 | 70 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,610 | type_to_ext_kind | def type_to_ext_kind(type_: Any) -> str:
if is_scalar_type(type_):
return "scalar_type_extension"
if is_object_type(type_):
return "object_type_extension"
if is_interface_type(type_):
return "interface_type_extension"
if is_union_type(type_):
return "union_type_extension"... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/possible_type_extensions.py | 80 | 95 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,611 | extension_kind_to_type_name | def extension_kind_to_type_name(kind: str) -> str:
return _type_names_for_extension_kinds.get(kind, "unknown type") | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/possible_type_extensions.py | 108 | 109 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,612 | __init__ | def __init__(self, context: ASTValidationContext):
super().__init__(context)
self.known_fragment_names: Dict[str, NameNode] = {} | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_fragment_names.py | 18 | 20 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,613 | enter_operation_definition | def enter_operation_definition(*_args: Any) -> VisitorAction:
return SKIP | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_fragment_names.py | 23 | 24 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,614 | enter_fragment_definition | def enter_fragment_definition(
self, node: FragmentDefinitionNode, *_args: Any
) -> VisitorAction:
known_fragment_names = self.known_fragment_names
fragment_name = node.name.value
if fragment_name in known_fragment_names:
self.report_error(
GraphQLError(
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_fragment_names.py | 26 | 40 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,615 | __init__ | def __init__(self, context: Union[ValidationContext, SDLValidationContext]):
super().__init__(context)
required_args_map: Dict[
str, Dict[str, Union[GraphQLArgument, InputValueDefinitionNode]]
] = {}
schema = context.schema
defined_directives = schema.directives if s... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/provided_required_arguments.py | 32 | 55 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,616 | leave_directive | def leave_directive(self, directive_node: DirectiveNode, *_args: Any) -> None:
# Validate on leave to allow for deeper errors to appear first.
directive_name = directive_node.name.value
required_args = self.required_args_map.get(directive_name)
if required_args:
arg_nodes = ... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/provided_required_arguments.py | 57 | 80 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,617 | __init__ | def __init__(self, context: ValidationContext):
super().__init__(context) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/provided_required_arguments.py | 92 | 93 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,618 | leave_field | def leave_field(self, field_node: FieldNode, *_args: Any) -> VisitorAction:
# Validate on leave to allow for deeper errors to appear first.
field_def = self.context.get_field_def()
if not field_def:
return SKIP
arg_nodes = field_node.arguments or ()
arg_node_map = {a... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/provided_required_arguments.py | 95 | 115 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,619 | is_required_argument_node | def is_required_argument_node(arg: InputValueDefinitionNode) -> bool:
return isinstance(arg.type, NonNullTypeNode) and arg.default_value is None | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/provided_required_arguments.py | 118 | 119 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,620 | enter_document | def enter_document(self, node: DocumentNode, *_args: Any) -> VisitorAction:
for definition in node.definitions:
if not isinstance(definition, ExecutableDefinitionNode):
def_name = (
"schema"
if isinstance(
definition, (S... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/executable_definitions.py | 28 | 49 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,621 | enter_fragment_spread | def enter_fragment_spread(self, node: FragmentSpreadNode, *_args: Any) -> None:
fragment_name = node.name.value
fragment = self.context.get_fragment(fragment_name)
if not fragment:
self.report_error(
GraphQLError(f"Unknown fragment '{fragment_name}'.", node.name)
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_fragment_names.py | 19 | 25 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,622 | __init__ | def __init__(self, context: ASTValidationContext):
super().__init__(context)
self.operation_defs: List[OperationDefinitionNode] = []
self.fragment_defs: List[FragmentDefinitionNode] = [] | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_fragments.py | 24 | 27 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,623 | enter_operation_definition | def enter_operation_definition(
self, node: OperationDefinitionNode, *_args: Any
) -> VisitorAction:
self.operation_defs.append(node)
return SKIP | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_fragments.py | 29 | 33 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,624 | enter_fragment_definition | def enter_fragment_definition(
self, node: FragmentDefinitionNode, *_args: Any
) -> VisitorAction:
self.fragment_defs.append(node)
return SKIP | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_fragments.py | 35 | 39 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,625 | leave_document | def leave_document(self, *_args: Any) -> None:
fragment_names_used = set()
get_fragments = self.context.get_recursively_referenced_fragments
for operation in self.operation_defs:
for fragment in get_fragments(operation):
fragment_names_used.add(fragment.name.value)
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_fragments.py | 41 | 53 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,626 | enter_list_value | def enter_list_value(self, node: ListValueNode, *_args: Any) -> VisitorAction:
# Note: TypeInfo will traverse into a list's item type, so look to the parent
# input type to check if it is a list.
type_ = get_nullable_type(self.context.get_parent_input_type()) # type: ignore
if not is_li... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 45 | 52 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,627 | enter_object_value | def enter_object_value(self, node: ObjectValueNode, *_args: Any) -> VisitorAction:
type_ = get_named_type(self.context.get_input_type())
if not is_input_object_type(type_):
self.is_valid_value_node(node)
return SKIP # Don't traverse further.
type_ = cast(GraphQLInputObje... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 54 | 73 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,628 | enter_object_field | def enter_object_field(self, node: ObjectFieldNode, *_args: Any) -> None:
parent_type = get_named_type(self.context.get_parent_input_type())
field_type = self.context.get_input_type()
if not field_type and is_input_object_type(parent_type):
parent_type = cast(GraphQLInputObjectType, ... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 75 | 88 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,629 | enter_null_value | def enter_null_value(self, node: NullValueNode, *_args: Any) -> None:
type_ = self.context.get_input_type()
if is_non_null_type(type_):
self.report_error(
GraphQLError(
f"Expected value of type '{type_}', found {print_ast(node)}.", node
)
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 90 | 97 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,630 | enter_enum_value | def enter_enum_value(self, node: EnumValueNode, *_args: Any) -> None:
self.is_valid_value_node(node) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 99 | 100 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,631 | enter_int_value | def enter_int_value(self, node: IntValueNode, *_args: Any) -> None:
self.is_valid_value_node(node) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 102 | 103 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,632 | enter_float_value | def enter_float_value(self, node: FloatValueNode, *_args: Any) -> None:
self.is_valid_value_node(node) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 105 | 106 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,633 | enter_string_value | def enter_string_value(self, node: StringValueNode, *_args: Any) -> None:
self.is_valid_value_node(node) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 108 | 109 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,634 | enter_boolean_value | def enter_boolean_value(self, node: BooleanValueNode, *_args: Any) -> None:
self.is_valid_value_node(node) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 111 | 112 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,635 | is_valid_value_node | def is_valid_value_node(self, node: ValueNode) -> None:
"""Check whether this is a valid value node.
Any value literal may be a valid representation of a Scalar, depending on that
scalar type.
"""
# Report any error at the full type expected by the location.
location_typ... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/values_of_correct_type.py | 114 | 163 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,636 | __init__ | def __init__(self, context: SDLValidationContext):
super().__init__(context)
self.known_type_names: Dict[str, NameNode] = {}
self.schema = context.schema | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_type_names.py | 16 | 19 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,637 | check_type_name | def check_type_name(self, node: TypeDefinitionNode, *_args: Any) -> VisitorAction:
type_name = node.name.value
if self.schema and self.schema.get_type(type_name):
self.report_error(
GraphQLError(
f"Type '{type_name}' already exists in the schema."
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_type_names.py | 21 | 44 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,638 | enter_inline_fragment | def enter_inline_fragment(self, node: InlineFragmentNode, *_args: Any) -> None:
context = self.context
frag_type = context.get_type()
parent_type = context.get_parent_type()
if (
is_composite_type(frag_type)
and is_composite_type(parent_type)
and not d... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/possible_fragment_spreads.py | 20 | 39 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,639 | enter_fragment_spread | def enter_fragment_spread(self, node: FragmentSpreadNode, *_args: Any) -> None:
context = self.context
frag_name = node.name.value
frag_type = self.get_fragment_type(frag_name)
parent_type = context.get_parent_type()
if (
frag_type
and parent_type
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/possible_fragment_spreads.py | 41 | 57 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,640 | get_fragment_type | def get_fragment_type(self, name: str) -> Optional[GraphQLCompositeType]:
context = self.context
frag = context.get_fragment(name)
if frag:
type_ = type_from_ast(context.schema, frag.type_condition)
if is_composite_type(type_):
return cast(GraphQLComposite... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/possible_fragment_spreads.py | 59 | 66 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,641 | enter_operation_definition | def enter_operation_definition(
self, node: OperationDefinitionNode, *_args: Any
) -> None:
if node.operation != OperationType.SUBSCRIPTION:
return
schema = self.context.schema
subscription_type = schema.subscription_type
if subscription_type:
operatio... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/single_field_subscriptions.py | 25 | 85 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,642 | enter_operation_definition | def enter_operation_definition(
self, node: OperationDefinitionNode, *_args: Any
) -> None:
variable_definitions = node.variable_definitions
seen_variable_definitions = group_by(
variable_definitions, attrgetter("variable.name.value")
)
for variable_name, variab... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_variable_names.py | 18 | 34 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,643 | __init__ | def __init__(self, context: Union[ValidationContext, SDLValidationContext]):
super().__init__(context)
locations_map: Dict[str, Tuple[DirectiveLocation, ...]] = {}
schema = context.schema
defined_directives = (
schema.directives if schema else cast(List, specified_directives... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_directives.py | 28 | 44 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,644 | enter_directive | def enter_directive(
self,
node: DirectiveNode,
_key: Any,
_parent: Any,
_path: Any,
ancestors: List[Node],
) -> None:
name = node.name.value
locations = self.locations_map.get(name)
if locations:
candidate_location = get_directive_... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_directives.py | 46 | 67 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,645 | get_directive_location_for_ast_path | def get_directive_location_for_ast_path(
ancestors: List[Node],
) -> Optional[DirectiveLocation]:
applied_to = ancestors[-1]
if not isinstance(applied_to, Node): # pragma: no cover
raise TypeError("Unexpected error in directive.")
kind = applied_to.kind
if kind == "operation_definition":
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_directives.py | 101 | 119 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,646 | __init__ | def __init__(self, context: SDLValidationContext):
super().__init__(context)
schema = context.schema
self.existing_type_map = schema.type_map if schema else {}
self.known_field_names: Dict[str, Dict[str, NameNode]] = defaultdict(dict) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_field_definition_names.py | 18 | 22 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,647 | check_field_uniqueness | def check_field_uniqueness(
self, node: ObjectTypeDefinitionNode, *_args: Any
) -> VisitorAction:
existing_type_map = self.existing_type_map
type_name = node.name.value
field_names = self.known_field_names[type_name]
for field_def in node.fields or []:
field_name... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_field_definition_names.py | 24 | 54 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,648 | has_field | def has_field(type_: Any, field_name: str) -> bool:
if is_object_type(type_) or is_interface_type(type_) or is_input_object_type(type_):
return field_name in type_.fields
return False | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_field_definition_names.py | 64 | 67 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,649 | __init__ | def __init__(self, context: ASTValidationContext):
super().__init__()
self.context = context | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/__init__.py | 19 | 21 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,650 | report_error | def report_error(self, error: GraphQLError) -> None:
self.context.report_error(error) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/__init__.py | 23 | 24 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,651 | __init__ | def __init__(self, context: SDLValidationContext) -> None:
super().__init__(context) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/__init__.py | 32 | 33 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,652 | __init__ | def __init__(self, context: ValidationContext) -> None:
super().__init__(context) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/__init__.py | 41 | 42 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,653 | enter_inline_fragment | def enter_inline_fragment(self, node: InlineFragmentNode, *_args: Any) -> None:
type_condition = node.type_condition
if type_condition:
type_ = type_from_ast(self.context.schema, type_condition)
if type_ and not is_composite_type(type_):
type_str = print_ast(type_... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/fragments_on_composite_types.py | 26 | 38 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,654 | enter_fragment_definition | def enter_fragment_definition(
self, node: FragmentDefinitionNode, *_args: Any
) -> None:
type_condition = node.type_condition
type_ = type_from_ast(self.context.schema, type_condition)
if type_ and not is_composite_type(type_):
type_str = print_ast(type_condition)
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/fragments_on_composite_types.py | 40 | 53 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,655 | enter_directive_definition | def enter_directive_definition(
self, node: DirectiveDefinitionNode, *_args: Any
) -> VisitorAction:
return self.check_arg_uniqueness(f"@{node.name.value}", node.arguments) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_definition_names.py | 33 | 36 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,656 | enter_interface_type_definition | def enter_interface_type_definition(
self, node: InterfaceTypeDefinitionNode, *_args: Any
) -> VisitorAction:
return self.check_arg_uniqueness_per_field(node.name, node.fields) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_definition_names.py | 38 | 41 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,657 | enter_interface_type_extension | def enter_interface_type_extension(
self, node: InterfaceTypeExtensionNode, *_args: Any
) -> VisitorAction:
return self.check_arg_uniqueness_per_field(node.name, node.fields) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_definition_names.py | 43 | 46 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,658 | enter_object_type_definition | def enter_object_type_definition(
self, node: ObjectTypeDefinitionNode, *_args: Any
) -> VisitorAction:
return self.check_arg_uniqueness_per_field(node.name, node.fields) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_definition_names.py | 48 | 51 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,659 | enter_object_type_extension | def enter_object_type_extension(
self, node: ObjectTypeExtensionNode, *_args: Any
) -> VisitorAction:
return self.check_arg_uniqueness_per_field(node.name, node.fields) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_definition_names.py | 53 | 56 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,660 | check_arg_uniqueness_per_field | def check_arg_uniqueness_per_field(
self,
name: NameNode,
fields: Collection[FieldDefinitionNode],
) -> VisitorAction:
type_name = name.value
for field_def in fields:
field_name = field_def.name.value
argument_nodes = field_def.arguments or ()
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_definition_names.py | 58 | 68 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,661 | check_arg_uniqueness | def check_arg_uniqueness(
self, parent_name: str, argument_nodes: Collection[InputValueDefinitionNode]
) -> VisitorAction:
seen_args = group_by(argument_nodes, attrgetter("name.value"))
for arg_name, arg_nodes in seen_args.items():
if len(arg_nodes) > 1:
self.repo... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_definition_names.py | 70 | 83 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,662 | __init__ | def __init__(self, context: SDLValidationContext):
super().__init__(context)
self.known_directive_names: Dict[str, NameNode] = {}
self.schema = context.schema | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_directive_names.py | 16 | 19 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,663 | enter_directive_definition | def enter_directive_definition(
self, node: DirectiveDefinitionNode, *_args: Any
) -> VisitorAction:
directive_name = node.name.value
if self.schema and self.schema.get_directive(directive_name):
self.report_error(
GraphQLError(
f"Directive '@... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_directive_names.py | 21 | 46 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,664 | __init__ | def __init__(self, context: Union[ValidationContext, SDLValidationContext]):
super().__init__(context)
schema = context.schema
self.existing_types_map = schema.type_map if schema else {}
defined_types = []
for def_ in context.document.definitions:
if is_type_definiti... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_type_names.py | 28 | 40 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,665 | enter_named_type | def enter_named_type(
self,
node: NamedTypeNode,
_key: Any,
parent: Node,
_path: Any,
ancestors: List[Node],
) -> None:
type_name = node.name.value
if (
type_name not in self.existing_types_map
and type_name not in self.defined_... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_type_names.py | 42 | 74 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,666 | is_sdl_node | def is_sdl_node(value: Union[Node, Collection[Node], None]) -> bool:
return (
value is not None
and not isinstance(value, list)
and (
is_type_system_definition_node(cast(Node, value))
or is_type_system_extension_node(cast(Node, value))
)
) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_type_names.py | 80 | 88 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,667 | enter_field | def enter_field(self, node: FieldNode, *_args: Any) -> None:
self.check_arg_uniqueness(node.arguments) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_names.py | 21 | 22 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,668 | enter_directive | def enter_directive(self, node: DirectiveNode, *args: Any) -> None:
self.check_arg_uniqueness(node.arguments) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_names.py | 24 | 25 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,669 | check_arg_uniqueness | def check_arg_uniqueness(self, argument_nodes: Collection[ArgumentNode]) -> None:
seen_args = group_by(argument_nodes, attrgetter("name.value"))
for arg_name, arg_nodes in seen_args.items():
if len(arg_nodes) > 1:
self.report_error(
GraphQLError(
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_argument_names.py | 27 | 37 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,670 | __init__ | def __init__(self, context: ASTValidationContext):
super().__init__(context)
self.operation_count = 0 | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/lone_anonymous_operation.py | 19 | 21 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,671 | enter_document | def enter_document(self, node: DocumentNode, *_args: Any) -> None:
self.operation_count = sum(
isinstance(definition, OperationDefinitionNode)
for definition in node.definitions
) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/lone_anonymous_operation.py | 23 | 27 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,672 | enter_operation_definition | def enter_operation_definition(
self, node: OperationDefinitionNode, *_args: Any
) -> None:
if not node.name and self.operation_count > 1:
self.report_error(
GraphQLError(
"This anonymous operation must be the only defined operation.", node
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/lone_anonymous_operation.py | 29 | 37 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,673 | __init__ | def __init__(self, context: Union[ValidationContext, SDLValidationContext]):
super().__init__(context)
directive_args: Dict[str, List[str]] = {}
schema = context.schema
defined_directives = schema.directives if schema else specified_directives
for directive in cast(List, defined... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_argument_names.py | 28 | 44 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,674 | enter_directive | def enter_directive(
self, directive_node: DirectiveNode, *_args: Any
) -> VisitorAction:
directive_name = directive_node.name.value
known_args = self.directive_args.get(directive_name)
if directive_node.arguments and known_args is not None:
for arg_node in directive_node... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_argument_names.py | 46 | 64 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,675 | __init__ | def __init__(self, context: ValidationContext):
super().__init__(context) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_argument_names.py | 78 | 79 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,676 | enter_argument | def enter_argument(self, arg_node: ArgumentNode, *args: Any) -> None:
context = self.context
arg_def = context.get_argument()
field_def = context.get_field_def()
parent_type = context.get_parent_type()
if not arg_def and field_def and parent_type:
arg_name = arg_node.... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/known_argument_names.py | 81 | 98 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,677 | __init__ | def __init__(self, context: ValidationContext):
super().__init__(context)
self.defined_variable_names: Set[str] = set() | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_undefined_variables.py | 19 | 21 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,678 | enter_operation_definition | def enter_operation_definition(self, *_args: Any) -> None:
self.defined_variable_names.clear() | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_undefined_variables.py | 23 | 24 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,679 | leave_operation_definition | def leave_operation_definition(
self, operation: OperationDefinitionNode, *_args: Any
) -> None:
usages = self.context.get_recursive_variable_usages(operation)
defined_variables = self.defined_variable_names
for usage in usages:
node = usage.node
var_name = no... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_undefined_variables.py | 26 | 43 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,680 | enter_variable_definition | def enter_variable_definition(
self, node: VariableDefinitionNode, *_args: Any
) -> None:
self.defined_variable_names.add(node.variable.name.value) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_undefined_variables.py | 45 | 48 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,681 | __init__ | def __init__(self, context: SDLValidationContext):
super().__init__(context)
old_schema = context.schema
self.already_defined = old_schema and (
old_schema.ast_node
or old_schema.query_type
or old_schema.mutation_type
or old_schema.subscription_typ... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/lone_schema_definition.py | 16 | 25 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,682 | enter_schema_definition | def enter_schema_definition(self, node: SchemaDefinitionNode, *_args: Any) -> None:
if self.already_defined:
self.report_error(
GraphQLError(
"Cannot define a new schema within a schema extension.", node
)
)
else:
if... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/lone_schema_definition.py | 27 | 39 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,683 | __init__ | def __init__(self, context: ValidationContext):
super().__init__(context)
self.variable_defs: List[VariableDefinitionNode] = [] | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_variables.py | 19 | 21 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,684 | enter_operation_definition | def enter_operation_definition(self, *_args: Any) -> None:
self.variable_defs.clear() | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_variables.py | 23 | 24 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,685 | leave_operation_definition | def leave_operation_definition(
self, operation: OperationDefinitionNode, *_args: Any
) -> None:
variable_name_used: Set[str] = set()
usages = self.context.get_recursive_variable_usages(operation)
for usage in usages:
variable_name_used.add(usage.node.name.value)
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_variables.py | 26 | 46 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,686 | enter_variable_definition | def enter_variable_definition(
self, definition: VariableDefinitionNode, *_args: Any
) -> None:
self.variable_defs.append(definition) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/no_unused_variables.py | 48 | 51 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,687 | __init__ | def __init__(self, context: Union[ValidationContext, SDLValidationContext]):
super().__init__(context)
unique_directive_map: Dict[str, bool] = {}
schema = context.schema
defined_directives = (
schema.directives if schema else cast(List, specified_directives)
)
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_directives_per_location.py | 33 | 53 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,688 | enter | def enter(self, node: Node, *_args: Any) -> None:
directives = getattr(node, "directives", None)
if not directives:
return
directives = cast(List[DirectiveNode], directives)
if isinstance(node, (SchemaDefinitionNode, SchemaExtensionNode)):
seen_directives = self.... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/unique_directives_per_location.py | 57 | 85 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,689 | enter_field | def enter_field(self, node: FieldNode, *_args: Any) -> None:
type_ = self.context.get_type()
if type_:
selection_set = node.selection_set
if is_leaf_type(get_named_type(type_)):
if selection_set:
field_name = node.name.value
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/scalar_leafs.py | 18 | 41 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,690 | reason_message | def reason_message(reason: "ConflictReasonMessage") -> str:
if isinstance(reason, list):
return " and ".join(
f"subfields '{response_name}' conflict"
f" because {reason_message(sub_reason)}"
for response_name, sub_reason in reason
)
return reason | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 38 | 45 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,691 | __init__ | def __init__(self, context: ValidationContext):
super().__init__(context)
# A memoization for when two fragments are compared "between" each other for
# conflicts. Two fragments may be compared many times, so memoizing this can
# dramatically improve the performance of this validator.
... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 57 | 67 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,692 | enter_selection_set | def enter_selection_set(self, selection_set: SelectionSetNode, *_args: Any) -> None:
conflicts = find_conflicts_within_selection_set(
self.context,
self.cached_fields_and_fragment_names,
self.compared_fragment_pairs,
self.context.get_parent_type(),
sel... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 69 | 86 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,693 | find_conflicts_within_selection_set | def find_conflicts_within_selection_set(
context: ValidationContext,
cached_fields_and_fragment_names: Dict,
compared_fragment_pairs: "PairSet",
parent_type: Optional[GraphQLNamedType],
selection_set: SelectionSetNode,
) -> List[Conflict]:
"""Find conflicts within selection set.
Find all co... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 156 | 214 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,694 | collect_conflicts_between_fields_and_fragment | def collect_conflicts_between_fields_and_fragment(
context: ValidationContext,
conflicts: List[Conflict],
cached_fields_and_fragment_names: Dict,
compared_fragment_pairs: "PairSet",
are_mutually_exclusive: bool,
field_map: NodeAndDefCollection,
fragment_name: str,
) -> None:
"""Collect c... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 217 | 275 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,695 | collect_conflicts_between_fragments | def collect_conflicts_between_fragments(
context: ValidationContext,
conflicts: List[Conflict],
cached_fields_and_fragment_names: Dict,
compared_fragment_pairs: "PairSet",
are_mutually_exclusive: bool,
fragment_name1: str,
fragment_name2: str,
) -> None:
"""Collect conflicts between frag... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 278 | 352 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,696 | find_conflicts_between_sub_selection_sets | def find_conflicts_between_sub_selection_sets(
context: ValidationContext,
cached_fields_and_fragment_names: Dict,
compared_fragment_pairs: "PairSet",
are_mutually_exclusive: bool,
parent_type1: Optional[GraphQLNamedType],
selection_set1: SelectionSetNode,
parent_type2: Optional[GraphQLNamed... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 355 | 434 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,697 | collect_conflicts_within | def collect_conflicts_within(
context: ValidationContext,
conflicts: List[Conflict],
cached_fields_and_fragment_names: Dict,
compared_fragment_pairs: "PairSet",
field_map: NodeAndDefCollection,
) -> None:
"""Collect all Conflicts "within" one collection of fields."""
# A field map is a keyed... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 437 | 467 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,698 | collect_conflicts_between | def collect_conflicts_between(
context: ValidationContext,
conflicts: List[Conflict],
cached_fields_and_fragment_names: Dict,
compared_fragment_pairs: "PairSet",
parent_fields_are_mutually_exclusive: bool,
field_map1: NodeAndDefCollection,
field_map2: NodeAndDefCollection,
) -> None:
"""... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 470 | 506 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,699 | find_conflict | def find_conflict(
context: ValidationContext,
cached_fields_and_fragment_names: Dict,
compared_fragment_pairs: "PairSet",
parent_fields_are_mutually_exclusive: bool,
response_name: str,
field1: NodeAndDef,
field2: NodeAndDef,
) -> Optional[Conflict]:
"""Find conflict.
Determines if... | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 509 | 582 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,700 | stringify_arguments | def stringify_arguments(field_node: FieldNode) -> str:
input_object_with_args = ObjectValueNode(
fields=tuple(
ObjectFieldNode(name=arg_node.name, value=arg_node.value)
for arg_node in field_node.arguments
)
)
return print_ast(sort_value_node(input_object_with_args)) | python | python-3.10.8.amd64/Lib/site-packages/graphql/validation/rules/overlapping_fields_can_be_merged.py | 585 | 592 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.