Skip to content

docs: add naming and design guide#2279

Open
sarahxsanders wants to merge 2 commits intographql:sourcefrom
sarahxsanders:naming
Open

docs: add naming and design guide#2279
sarahxsanders wants to merge 2 commits intographql:sourcefrom
sarahxsanders:naming

Conversation

@sarahxsanders
Copy link
Contributor

@sarahxsanders sarahxsanders commented Dec 26, 2025

Description

adds a new guide for the "schema governance" series on graphql.org/learn Includes new guide: Establish naming conventions and design standards:

  • Field and type naming patterns
  • Boolean field prefixes
  • Mutation naming strategies
  • Input/output type suffixes
  • Nullability patterns and null bubbling behavior
  • Schema documentation best practices
  • Custom scalars for domain-specific types
  • Error handling approaches
  • Pagination with Relay connections
  • Schema linting with GraphQL-ESLint
  • CI/CD validation pipeline examples
  • Common anti-patterns to avoid

PLEASE DO NOT MERGE, THIS IS PART OF A SERIES OF GUIDES ON SCHEMA GOVERNANCE. THERE ARE TWO MORE GUIDES TO FOLLOW

Note: this needs heavy technical review - the content is based on heavy research i did, but since there's no strict naming conventions/guidance defined in the schema we will want to proceed with confidence that everything here is guidance we want to put out there!

@vercel
Copy link

vercel bot commented Dec 26, 2025

@sarahxsanders is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of very important things in that page!

I'd suggest breaking it down in different pages so those important topics get each their own entry points:

  • naming, descriptions & linting
  • nullability
  • error handling
  • scalars
  • pagination
  • anti-patterns

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is the current recommendation but nullable fields are also a massive pain for client developers. With all the work going on about onError: "NULL" and @semanticNonNull, I wouldn't necessarily repeat that recommendation in 2026.

Can we leave this out until we have onError in the spec?

Comment on lines 13 to 21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe add directives? (camelCase if I'm not mistaken?, like @include, @semanticNonNull, etc...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also recommend adding type descriptions?

Comment on lines 265 to 266
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for being explicit about what null represents.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might also be worth mentioning https://scalars.graphql.org/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are looots of things to say on error handling, see also #2208

Might be worth extracting to a separate page?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth collaborating and getting both efforts merged?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Also a reason I'd prefer a separate page. We can merge parts of this PR now and collaborate on the errors page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen a recommendation somewhere (but can't remember where) to add the Connection.nodes as a shortcut and I like it. Curious to hear what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants