Generating name and description fields for queries and mutations as per the naming guidelines#619
Merged
severussundar merged 100 commits intoAug 12, 2022
Conversation
…raphQL Object type definition.
severussundar
marked this pull request as ready for review
August 1, 2022 16:14
severussundar
requested review from
Aniruddh25,
JelteF,
Mathos1432,
aaronburtle,
aaronpowell,
abhishekkumams,
ayush3797,
gledis69,
jarupatj,
junsu0ms,
mbhaskar,
milismsft,
seantleonard,
swviswan and
tarazou9
as code owners
August 1, 2022 16:14
Contributor
|
Are we potentially breaking the naming expectations that a person has from their database? If we have a table named Is that a level of opinionation that we're happy to have in the runtime? |
…for-delete-mutations-in-schema
Aniruddh25
reviewed
Aug 2, 2022
…of relevant unit tests.
…dev/shyamsundarj/singularizing-entity-names-for-delete-mutations-in-schema
Aniruddh25
reviewed
Aug 12, 2022
Aniruddh25
reviewed
Aug 12, 2022
…for-delete-mutations-in-schema
…for-delete-mutations-in-schema
seantleonard
approved these changes
Aug 12, 2022
seantleonard
left a comment
Contributor
There was a problem hiding this comment.
Thanks for bringing to finish line. A few comments/nits about checks on tests for pluralize being not null.
Aniruddh25
approved these changes
Aug 12, 2022
Aniruddh25
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Thanks for pushing through this and validating the various scenarios.
severussundar
deleted the
dev/shyamsundarj/singularizing-entity-names-for-delete-mutations-in-schema
branch
August 12, 2022 19:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Naming Guidelines
We assume that the entity name defined by the user will be singular. Users have the option to provide singular and plural names for the entities through the config. When singular and plural names are provided, the queries and mutations will be generated with these specified names. When they are not specified, the entity name will be used for generating the query and mutation fields in the schema. The _by_pk and list queries will be generated with first letter in lowercase as a best practice.
What is the Change?
The following fields were changed to follow the naming guidelines.
Name and description for _by_pk query field.
Name and description for the query to fetch all items
Description for mutations
How was this tested?
Unit tests
Updating the config files with singular plural definitions and checking the schema
Entity Stocks has the following graphQL definition in the config file.
"Stocks": { "source": "stocks", "rest": true, "graphql": { "type": { "singular": "Stock", "plural": "Stocks" } }