Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directive to support pluralizing names #3574

Closed
saihaj opened this issue May 19, 2022 · 5 comments
Closed

Directive to support pluralizing names #3574

saihaj opened this issue May 19, 2022 · 5 comments

Comments

@saihaj
Copy link
Member

saihaj commented May 19, 2022

Today in subgraph schema definition if you use word like metadata as an entity name it will not generate a plural for the query that can return a list of items is not generated. This is potentially because there is no plural for that word that can be generated.

It would be nice if @entity directive could support taking an argument to which we can give a name for what to name plural type.

@entity(plural: String)
@github-actions
Copy link

Looks like this issue has been open for 6 months with no activity. Is it still relevant? If not, please remember to close it.

@github-actions github-actions bot added the Stale label Nov 17, 2022
@psparacino
Copy link

Bumping this one. Very relevant to fix! Just torched ~90 mins on this one.

Probably will take a look myself later on as this issue doesn't look like it got any attention.

@paymog
Copy link

paymog commented Nov 13, 2023

Bump

@azf20
Copy link
Contributor

azf20 commented Dec 1, 2023

This is potentially because there is no plural for that word that can be generated.

@lutter @saihaj is this indeed what is happening? What is the underlying logic?

@lutter
Copy link
Collaborator

lutter commented Jan 15, 2024

Since I am deep into that code, I am changing it so that if an entity type has a name whose plural is identical we add _collection to the name; for example, if you have entity type Stats, we would then have stats for single-entity queries and stats_collection for the collection. (I was very tempted to make that stats_but_plural but that might not be the best UX 😉)

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

No branches or pull requests

5 participants