Example #1
0
 def rejects_a_schema_with_an_incorrect_ast_node():
     with raises(TypeError) as exc_info:
         # noinspection PyTypeChecker
         GraphQLSchema(GraphQLObjectType("Query", {}),
                       ast_node=TypeDefinitionNode())
     msg = str(exc_info.value)
     assert msg == "Schema AST node must be a SchemaDefinitionNode."
 def check_type_definition_node():
     assert not is_type_definition_node(Node())
     assert not is_type_definition_node(DocumentNode())
     assert is_type_definition_node(TypeDefinitionNode())
     assert is_type_definition_node(ScalarTypeDefinitionNode())
     assert not is_type_definition_node(TypeSystemDefinitionNode())
     assert not is_type_definition_node(DefinitionNode())
     assert not is_type_definition_node(TypeNode())
 def returns_description_of_type_definition_node():
     assert (
         get_description(
             TypeDefinitionNode(
                 description=StringValueNode(value="This is a type definition")
             )
         )
         == "This is a type definition"
     )