nuwave / nuwave/lighthouse

Allow changing name generation of order by's

Open
#2,164 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
3.5k
Forks
468
Avg merge
3h 9m
Merged PRs (30d)
2

Description

Currently the default order by input field is always named OrderByClause and if using custom order by's it will generate based on different options inside of the OrderByDirective.

In our system we would like to add a rule which forces all input types to be suffixed with Input, however we cannot control the naming generation here.

What I am proposing is a solution where we move all the name generation into its own class with a contract so all the responsibility for the naming is in one place.
This class could have config options for setting a suffix and prefix to make it simple to change this part, and if more customisation would be needed, then people can just make a custom implementation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the OrderByDirective and the generated OrderByClause input naming paths. Review how custom order-bys choose names, then determine the contract and configuration needed for prefixes, suffixes, and custom implementations. Done means order-by input names can follow a configurable naming rule without breaking existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, php
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.