Skip to content

Conversation

@dmythro
Copy link

@dmythro dmythro commented Sep 11, 2025

Mainly, wanted to add customizable naming to GraphQL schema and don't break existing code, so single entity suffix is still "Single", list suffix is "" by default.

My projects use singular naming for entities (eg "user", "account"), so naturally I'd like to see suffixes like this as default behavior is a bit confusing:

suffixes: {
  list: 's',
  single: '',
},

Copilot AI review requested due to automatic review settings September 11, 2025 10:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds configurable suffixes for GraphQL naming to allow customization of query field names without breaking existing code. It maintains backward compatibility by keeping the default suffixes as an empty string for list queries and "Single" for single entity queries.

  • Adds suffixes configuration option to BuildSchemaConfig type with optional list and single properties
  • Implements suffix validation to prevent conflicts when both suffixes are identical
  • Updates all database builders (SQLite, PostgreSQL, MySQL) to use configurable suffixes

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types.ts Adds new suffixes configuration option to BuildSchemaConfig type
src/index.ts Implements suffix defaults, validation logic, and passes suffixes to generators
src/util/builders/sqlite.ts Updates select functions to accept and use configurable suffixes
src/util/builders/pg.ts Updates select functions to accept and use configurable suffixes
src/util/builders/mysql.ts Updates select functions to accept and use configurable suffixes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant