Cell Query Operation name not camelCase-d if use underscore in generation
See original GitHub issueAs of v0.14.0, cell queries now get an operation name to work with Storybook:
See: https://github.com/redwoodjs/redwood/pull/867
Example:
export const QUERY = gql`
- query {
+ query TestQuery {
userProfile {
id
}
}
`
I created a cell via the generator:
yarn rw g cell my_sites
and
✔ Generating cell files...
✔ Writing
`./web/src/components/MySitesCell/MySitesCell.mock.j
s`...
✔ Writing
`./web/src/components/MySitesCell/MySitesCell.storie
s.js`...
✔ Writing
`./web/src/components/MySitesCell/MySitesCell.test.j
s`...
✔ Writing `./web/src/components/MySitesCell/MySi
tesCell.js`...
✨ Done in 1.57s.
the files, used the MySite upper camelCasing.
However, my query operation is
export const QUERY = gql`
query my_sitesQuery {
mySites {
id
}
}
`
When I generated SitesCell it is
export const QUERY = gql`
query sitesQuery {
sites {
id
}
}
`
I expected either
query MySitesQuery {
or
``query mySitesQuery {`
but not
``query my_sitesQuery {`
That said:
yarn rw g cell MySites
yarn rw g cell mySites
generates
export const QUERY = gql`
query MySitesQuery {
mySites {
id
}
}
`
Is there a preferred case?
I noticed that in the GraphQL documentation the example is PascalCase:
query HeroNameAndFriends {
hero {
name
friends {
name
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
T4 FieldName in camelCase without Underscore?
How can I generate a field name without the '_' character? Also, where is the documentation for T4? I'm finding plenty of resources...
Read more >What do you think about 'Camel case' vs. 'Underscore' naming ...
One disadvantage of using camel case names is that in some cases of ... that underscores are actually not bad, and the camelCase...
Read more >Zalando RESTful API and Event Guidelines
SHOULD not use /api as base path; MUST pluralize resource names ... limit number of sub-resource levels; MUST use snake_case (never camelCase) for...
Read more >(PDF) To camelcase or under-score - ResearchGate
boxes have essentially no effect on reading times or on the ... fier style (the use of underscores or camel casing) affects the....
Read more >10 Best Practices for Naming REST API Endpoints
When I think about this, it is more like names that use common sense. Try to position yourself as the consumer. As someone...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@peterp Happy to!
Right because, usually your component name will not be pascal cased: