Naming conventions
Naming habits for a readable schema: PascalCase types, camelCase fields, SCREAMING_SNAKE_CASE enum values, verb-first mutations, Input and Payload suffixes.
Naming conventions
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Types, interfaces, unions and enums are `PascalCase`; fields and arguments are `camelCase`; enum values are `SCREAMING_SNAKE_CASE`. These are conventions, not rules the parser enforces.
- Mutations are verb-first and camelCase, such as `publishPost`; their input type is `PublishPostInput` and their payload is `PublishPostPayload`.
- Name for the domain concept, not the storage or the screen: `Post`, not `PostTable` or `PostCardData`.
- Skip noise: no `get` prefix on query fields, no `Type` suffix on types, plural names for list fields, `is` or `has` for booleans.
- The parser enforces only the name grammar: letters, digits and underscores, not starting with a digit, and nothing starting with a double underscore, which is reserved for introspection.
- A name is a long-lived promise; renaming means adding a new field and deprecating the old one.
The problem: names are the interface
Clients read your schema in GraphiQL, in autocomplete and in generated types. They rarely read your resolvers. The names are the whole experience of using the API. A bad name also cannot be repaired by a patch release: renaming a field breaks every client that uses it, so the first name tends to stay forever.
A convention is useful because it removes decisions. Once everyone agrees on casing and suffixes, a developer can guess the name of a thing they have not seen yet.
What the parser enforces
Very little. A name must match letters, digits and underscores, and cannot start with a digit. I tested a few against graphql-js 17.1.0:
my-field syntax error, hyphens are not names
1st syntax error
__hidden schema validation error: names beginning "__" are reserved
by GraphQL introspection
_private, a1 valid
Everything else is convention.
Casing
| Thing | Convention | Example |
|---|---|---|
| Type, interface, union, enum, scalar, input | PascalCase |
Post, PostStatus, DateTime |
| Field, argument, directive | camelCase |
publishedAt, first |
| Enum value | SCREAMING_SNAKE_CASE |
DRAFT, PUBLISHED |
This is also the casing the GraphQL specification’s own examples and introspection types use, which is why tools expect it.
A recurring snag is a database with snake_case columns. The schema should use camel case regardless, with a field resolver to bridge, as in connecting a database: createdAt: (post) => post.created_at. The storage names are not the client’s concern.
Mutations, inputs and payloads
Mutations are verbs: createPost, publishPost, deleteComment. Start with the action and follow with the thing. A client reading postPublish and publishPost side by side would not know which is the odd one out; verb first is the usual pick, and consistency matters more than which.
From each mutation derive two type names:
type Mutation {
publishPost(input: PublishPostInput!): PublishPostPayload!
}
input PublishPostInput { id: ID! }
type PublishPostPayload { post: Post userErrors: [UserError!]! }
Give each mutation its own input and payload, even when two look identical today. Sharing PostInput between create and update couples them: the day create needs a required field that update must not require, you have a problem. The reasoning is in designing mutation inputs and payloads.
Names that earn their place
Drop noise. A query field is read as “give me posts”, so posts is enough; getPosts adds a word that means nothing. A type is not a table or a DTO, so Post, not PostType or PostTable.
Use plurals for lists. posts: [Post!]! and author: Author! tell you the cardinality before you read the type. For paginated lists, the connection type is PostConnection and its entries are PostEdge, as in Relay connections.
Booleans read as questions. isPublished, hasUnreadMessages. Prefer a timestamp such as publishedAt when the moment matters, since it carries the flag too (null means not yet).
Avoid vague containers. data, result, item and info say nothing, and they collide with GraphQL’s own vocabulary. Name the thing: PostSummary, PublishPostPayload.
Qualify only when needed. In a schema covering several domains, Account may mean a login in one and a ledger in another. Prefix with the domain (BillingAccount) only when two real names would collide. A prefix on every type is noise.
Do not name for the screen. A type called HomePageCard freezes the UI into the API; the next redesign leaves a pile of misleading types. Name types after the domain concept, and let each screen select what it needs.
Enum values
Enum values are SCREAMING_SNAKE_CASE: DRAFT, PUBLISHED, ARCHIVED. They are sent as bare identifiers in queries (status: PUBLISHED), not strings, which is another reason to keep them tidy. The enums lesson covers their mechanics. If a value might be misread, say what it means in its description rather than by making the name long.
Renaming is a migration
Because names are public, changing one is a migration, not an edit. You add the new field, mark the old with @deprecated(reason: "Use name."), watch usage fall, and remove it later. In my test on an Author type, introspection hid the deprecated fullName by default and revealed it only with includeDeprecated: true. The process has its own lesson: evolving a schema without versions.
What the video covers
Jeff Dolle of The Guild gave this 25-minute talk at GraphQL TV, published in May 2026. Its description quotes “there are only two hard things in computer science: cache invalidation and naming things” and says he will share what he has learned about schema design: proven design philosophies, designing for forward compatibility, exposing errors through types, and avoiding ambiguous or misleading type names. It then walks through a product design meeting that turns user stories into a complete schema. Naming is the talk’s frame but only part of its content. The casing table above is this lesson’s own addition, and I could not read a transcript to confirm how the talk treats casing.
Where this fits
Names settle what clients read. The next decision settles what they can rely on: which fields might be missing. Next: nullability in practice.
Check yourself
What are the conventional cases for type names, field names and enum values?
`PostStatus` for types, `publishedAt` for fields and arguments, and `PUBLISHED` for enum values.
Given a mutation named `publishPost`, what should its input and payload types be called?
`PublishPostInput` and `PublishPostPayload`. Deriving both from the mutation name makes them easy to find and prevents reuse that couples unrelated mutations.
Which of these does GraphQL itself reject: `my-field`, `__hidden`, `PostStatus`?
`my-field` is a syntax error because hyphens are not allowed, and `__hidden` fails schema validation because names starting with double underscore are reserved for introspection. `PostStatus` is fine.
Why avoid a name like `getPosts` for a query field?
Every query field gets something, so `get` adds nothing. `posts` reads better in the operation and matches the type of what it returns.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.