Mirror of https://github.com/roostorg/coop github.com/roostorg/coop
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 557ff54b2b435e5f1e789c6a8a4e1bebf2d7deb6 19 lines 623 B view raw
1const { pascalCase } = require('change-case-all'); 2 3// Add 'GraphQL' prefix to all generated GraphQL types 4function AddGraphQLPrefix(str) { 5 const result = pascalCase(str); 6 if (result.length === 0) { 7 // pascalCase function has a bug that, if you pass _ to it, 8 // it will return an empty string. In this case, just return 9 // the original 10 return str; 11 } 12 13 // Unsure why, but for some reason 'GraphQl' is being inserted 14 // into the middle of some types. This is hacky but should work 15 // to remove that when it happens. 16 return `GQL${result.replace('Gql', '')}`; 17} 18 19module.exports = AddGraphQLPrefix;