Naming Convention
These rules enforce naming conventions.FIELD_NAMES_SHOULD_BE_CAMEL_CASE
FIELD_NAMES_SHOULD_BE_CAMEL_CASE
Field names should always use camelCase.Correct:
Violation
Correct
TYPE_NAMES_SHOULD_BE_PASCAL_CASE
TYPE_NAMES_SHOULD_BE_PASCAL_CASE
Type names should always use PascalCase.
Violation
Correct
SHOULD_NOT_HAVE_TYPE_PREFIX
SHOULD_NOT_HAVE_TYPE_PREFIX
A type’s name should never be prefixed with ‘Type’.
Violation
Correct
SHOULD_NOT_HAVE_TYPE_SUFFIX
SHOULD_NOT_HAVE_TYPE_SUFFIX
A type’s name should never be suffixed with ‘Type’.
Violation
Correct
SHOULD_NOT_HAVE_INPUT_PREFIX
SHOULD_NOT_HAVE_INPUT_PREFIX
An input’s name should never be prefixed with ‘Input’.
Violation
Correct
SHOULD_HAVE_INPUT_SUFFIX
SHOULD_HAVE_INPUT_SUFFIX
An input’s name should always be suffixed with ‘Input’.
Violation
Correct
SHOULD_NOT_HAVE_ENUM_PREFIX
SHOULD_NOT_HAVE_ENUM_PREFIX
An enum’s name should never be prefixed with ‘Enum’.
Violation
Correct
SHOULD_NOT_HAVE_ENUM_SUFFIX
SHOULD_NOT_HAVE_ENUM_SUFFIX
An enum’s name should never be suffixed with ‘Enum’.
Violation
Correct
SHOULD_NOT_HAVE_INTERFACE_PREFIX
SHOULD_NOT_HAVE_INTERFACE_PREFIX
An interface type’s name should never be prefixed with ‘Interface’.
Violation
Correct
SHOULD_NOT_HAVE_INTERFACE_SUFFIX
SHOULD_NOT_HAVE_INTERFACE_SUFFIX
An interface type’s name should never be suffixed with ‘Interface’.
Violation
Correct
ENUM_VALUES_SHOULD_BE_UPPER_CASE
ENUM_VALUES_SHOULD_BE_UPPER_CASE
Enum values should always use UPPER_CASE.
Violation
Correct
Alphabetical Sort
These rules enforce the arrangement of types, fields and so on in the schema.ORDER_FIELDS
ORDER_FIELDS
Ensures all fields are sorted in alphabetical order.
Violation
Correct
ORDER_ENUM_VALUES
ORDER_ENUM_VALUES
Ensures all enum values are sorted in alphabetical order.
Violation
Correct
ORDER_DEFINITIONS
ORDER_DEFINITIONS
Ensures all definitions are sorted in alphabetical order.Violation:Correct:
Violation
Correct
Others
ALL_TYPES_REQUIRE_DESCRIPTION
ALL_TYPES_REQUIRE_DESCRIPTION
Ensures all type definitions are accompanied by a description.The types include:-
- ObjectTypeDefinition
- InterfaceTypeDefinition
- EnumTypeDefinition
- ScalarTypeDefinition
- InputObjectTypeDefinition
- UnionTypeDefinition
Violation
Correct
DISALLOW_CASE_INSENSITIVE_ENUM_VALUES
DISALLOW_CASE_INSENSITIVE_ENUM_VALUES
Ensures enum values eliminate duplicates by disallowing case insensitivity.
Violation
Correct
NO_TYPENAME_PREFIX_IN_TYPE_FIELDS
NO_TYPENAME_PREFIX_IN_TYPE_FIELDS
Ensures field names do not include their type’s name as a prefix.
Violation
Correct
REQUIRE_DEPRECATION_REASON
REQUIRE_DEPRECATION_REASON
Requires providing a reason for the @deprecated directive.
Violation
Correct
REQUIRE_DEPRECATION_DATE
REQUIRE_DEPRECATION_DATE
Requires providing a deletion date for the @deprecated directive.
Violation
Correct