## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://cosmo-docs.wundergraph.com/llms.txt)

Use this file to discover all available pages before exploring further.

### Naming Convention

These rules enforce naming conventions.

**FIELD_NAMES_SHOULD_BE_CAMEL_CASE**

Field names should always use camelCase.

**Violation**

```graphql
 type User {
   First_Name: String
 }
```

**Correct:**

```graphql
 type User {
   firstName: String
 }
```

**TYPE_NAMES_SHOULD_BE_PASCAL_CASE**

Type names should always use PascalCase.

**Violation**

```graphql
 type userProject {
   id: ID!
 }
```

**Correct:**

```graphql
 type UserProject {
   id: ID!
 }
```

**SHOULD_NOT_HAVE_TYPE_PREFIX**

A type’s name should never be prefixed with ‘Type’.

**Violation**

```graphql
 type TypeUser {
   id: ID!
 }
```

**Correct:**

```graphql
 type User {
   id: ID!
 }
```

**SHOULD_NOT_HAVE_TYPE_SUFFIX**

A type’s name should never be suffixed with ‘Type’.

**Violation**

```graphql
 type UserType {
   id: ID!
 }
```

**Correct:**

```graphql
 type User {
   id: ID!
 }
```

**SHOULD_NOT_HAVE_INPUT_PREFIX**

An input’s name should never be prefixed with ‘Input’.

**Violation**

```graphql
 input InputUser {
   id: ID!
 }
```

**Correct:**

```graphql
 input UserInput {
   id: ID!
 }
```

**SHOULD_HAVE_INPUT_SUFFIX**

An input’s name should always be suffixed with ‘Input’.

**Violation**

```graphql
 input User {
   id: ID!
 }
```

**Correct:**

```graphql
 input UserInput {
   id: ID!
 }
```

**SHOULD_NOT_HAVE_ENUM_PREFIX**

An enum’s name should never be prefixed with ‘Enum’.

**Violation**

```graphql
 enum EnumUserStatus {
   ADMIN
   USER
 }
```

**Correct:**

```graphql
 enum UserStatus {
   ADMIN
   USER
 }
```

**SHOULD_NOT_HAVE_ENUM_SUFFIX**

An enum’s name should never be suffixed with ‘Enum’.

**Violation**

```graphql
 enum UserStatusEnum {
   ADMIN
   USER
 }
```

**Correct:**

```graphql
 enum UserStatus {
   ADMIN
   USER
 }
```

**SHOULD_NOT_HAVE_INTERFACE_PREFIX**

An interface type’s name should never be prefixed with ‘Interface’.

**Violation**

```graphql
 interface InterfaceUser {
   id: ID!
 }
```

**Correct:**

```graphql
 interface User {
   id: ID!
 }
```

**SHOULD_NOT_HAVE_INTERFACE_SUFFIX**

An interface type’s name should never be suffixed with ‘Interface’.

**Violation**

```graphql
 interface UserInterface {
   id: ID!
 }
```

**Correct:**

```graphql
 interface User {
   id: ID!
 }
```

**ENUM_VALUES_SHOULD_BE_UPPER_CASE**

Enum values should always use UPPER_CASE.

**Violation**

```graphql
 enum UserRole {
   admin
   user
 }
```

**Correct:**

```graphql
 enum UserRole {
   ADMIN
   USER
 }
```

### Alphabetical Sort

These rules enforce the arrangement of types, fields and so on in the schema.

**ORDER_FIELDS**

Ensures all fields are sorted in alphabetical order.

**Violation**

```graphql
 type User {
   lastName: String
   firstName: String
 }
```

**Correct:**

```graphql
 type User {
   firstName: String
   lastName: String
 }
```

**ORDER_ENUM_VALUES**

Ensures all enum values are sorted in alphabetical order.

**Violation**

```graphql
 enum UserRole {
   USER
   ADMIN
 }
```

**Correct:**

```graphql
 enum UserRole {
   ADMIN
   USER
 }
```

**ORDER_DEFINITIONS**

Ensures all definitions are sorted in alphabetical order.

**Violation:**

```graphql
 type User{
   id: ID;
   name: String;
 }

type Member {
   id: ID;
   name: String;
 }
```

**Correct:**

```graphql
 type Member {
   id: ID;
   name: String;
 }

type User{
   id: ID;
   name: String;
 }
```

### Others

**ALL_TYPES_REQUIRE_DESCRIPTION**

Ensures all type definitions are accompanied by a description.
The types include:

- ObjectTypeDefinition
- InterfaceTypeDefinition
- EnumTypeDefinition
- ScalarTypeDefinition
- InputObjectTypeDefinition
- UnionTypeDefinition

**Violation**

```graphql
 type User {
   id: ID!
}

interface Member {
   id: ID!
}
```

**Correct:**

```graphql
 # Represents a user in the system
 type User {
   id: ID!
 }

# Represents a member in the system
 interface Member {
   id: ID!
 }
```

**DISALLOW_CASE_INSENSITIVE_ENUM_VALUES**

Ensures enum values eliminate duplicates by disallowing case insensitivity.

**Violation**

```graphql
 enum UserRole {
   ADMIN
   admin
 }
```

**Correct:**

```graphql
 enum UserRole {
   ADMIN
 }
```

**NO_TYPENAME_PREFIX_IN_TYPE_FIELDS**

Ensures field names do not include their type’s name as a prefix.

**Violation**

```graphql
 type User {
   userId: ID!
 }
```

**Correct:**

```graphql
 type User {
   id: ID!
 }
```

**REQUIRE_DEPRECATION_REASON**

Requires providing a reason for the @deprecated directive.

**Violation**

```graphql
 type User {
   id: ID! @deprecated
 }
```

**Correct:**

```graphql
 type User {
   id: ID! @deprecated(reason: "No longer in use")
 }
```

**REQUIRE_DEPRECATION_DATE**

Requires providing a deletion date for the @deprecated directive.

**Violation**

```graphql
 type User {
   id: ID! @deprecated(reason: "No longer in use")
 }
```

**Correct:**

```graphql
 type User {
   id: ID! @deprecated(reason: "No longer in use", date: "2023-01-01")
 }
```
