BuoySoftware / guides

Documentation for Buoy Software
2 stars 0 forks source link

GraphQL Operation Naming Convention #51

Closed aq1018 closed 1 year ago

aq1018 commented 1 year ago

Since graphql-codegen puts everything in one file, there can be naming collisions unless we give some thoughts on how we name our queries, mutations, subscriptions, and fragments.

I don't really have any good idea on a convention, but would like to bring this up so we can avoid future maintenance issues. Ideas are welcome.

rayfaddis commented 1 year ago

Replying here for posterity (in addition to a few GH threads on different peoples PRs).

Current convention is for queries, mutations, and fragments filenames to match the respective GQL name. This allows a component and it's sub-components to define multiple queries/mutations/fragments without clashing and also keeps things more descriptive in general.