def test_fields_correct_type_no_small_number_suggestions(): message = FieldsOnCorrectType.undefined_field_message('T', 'f', ['A', 'B']) assert message == ( 'Cannot query field "T" on type "f". ' + 'However, this field exists on "A", "B". ' + 'Perhaps you meant to use an inline fragment?' )
def test_fields_correct_type_lot_suggestions(): message = FieldsOnCorrectType.undefined_field_message('T', 'f', ['A', 'B', 'C', 'D', 'E', 'F']) assert message == ( 'Cannot query field "T" on type "f". ' + 'However, this field exists on "A", "B", "C", "D", "E", ' + 'and 1 other types. '+ 'Perhaps you meant to use an inline fragment?' )
def undefined_field(field, type, line, column): return { 'message': FieldsOnCorrectType.undefined_field_message(field, type), 'locations': [SourceLocation(line, column)] }
def undefined_field(field, type, line, column): return { 'message': FieldsOnCorrectType.undefined_field_message(field, type), 'locations': [SourceLocation(line, column)] }
def undefined_field(field, type, line, column): return { "message": FieldsOnCorrectType.undefined_field_message(field, type), "locations": [SourceLocation(line, column)], }
def error(field, type, line, column): return { 'message': FieldsOnCorrectType.message(field, type), 'locations': [SourceLocation(line, column)] }
def test_fields_correct_type_no_suggestion(): message = FieldsOnCorrectType.undefined_field_message('T', 'f', []) assert message == 'Cannot query field "T" on type "f".'