Azure / Azure/data-api-builder

"one-to-many" relationship property should be pluralized if configured property name is singular

Open
#470 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #478 by @yorek — closed without merging
graphql has-pr improvement needs discussion
Dominant language
C#
Stars
1.5k
Forks
372
Avg merge
3d 22h
Merged PRs (30d)
9

Description

The "many" side of the relationship doesn't get pluralized correctly. For example, this configuration

"category": {
      "source": "dbo.categories",
      "relationships": {
        "book": {
          "cardinality": "many",
          "target.entity": "book"
        }
      },
      "permissions": [{
        "role": "anonymous",
        "actions": [ "*" ]
        }]
    }

should allow this GraphQL to be executed:

{
	categories {
		items {
			category 
			books {
				items {
					id
					title
				}
			}
		}
	}
}

but instead I have this ("book" instead of "books")

{
	categories {
		items {
			category 
			book {
				items {
					id
					title
				}
			}
		}
	}
}

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 reproducing the issue with the shown category relationship configuration and GraphQL queries. Done means the configured singular "book" property is exposed as "books" on the many side while the relationship remains queryable as shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, graphql
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.