Skip to content

Commit 59b0221

Browse files
Moumoulsdavimacedo
authored andcommitted
GraphQL: Renaming Types/Inputs (#5883)
* Renaming GraphQL Types/Inputs * Add Native Type to avoid collision * Use pluralize for renaming * Fixing tests * Improve name collision management - tests passsing * Renaming few more default types * Rename file input * Reverting fields types to not collide with the relay spec types Improver users mutations * Adding ArrayResult to the reserved list * Fixing tests * Add more unit tests to ParseGraphQLSchema * Test transformClassNameToGraphQL * Name collision tests
1 parent cf6e79e commit 59b0221

20 files changed

+1505
-864
lines changed

package-lock.json

Lines changed: 16 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"node-rsa": "1.0.5",
4646
"parse": "2.6.0",
4747
"pg-promise": "9.0.1",
48+
"pluralize": "^8.0.0",
4849
"redis": "2.8.0",
4950
"semver": "6.3.0",
5051
"subscriptions-transport-ws": "0.9.16",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const {
2+
transformClassNameToGraphQL,
3+
} = require('../lib/GraphQL/transformers/className');
4+
5+
describe('transformClassNameToGraphQL', () => {
6+
it('should remove starting _ and tansform first letter to upper case', () => {
7+
expect(
8+
['_User', '_user', 'User', 'user'].map(transformClassNameToGraphQL)
9+
).toEqual(['User', 'User', 'User', 'User']);
10+
});
11+
});

0 commit comments

Comments
 (0)