Skip to content

Instantly share code, notes, and snippets.

@carloseberhardt
Created February 20, 2023 21:20
Show Gist options
  • Save carloseberhardt/7b404a8449698c955871c5d75b616eba to your computer and use it in GitHub Desktop.
Save carloseberhardt/7b404a8449698c955871c5d75b616eba to your computer and use it in GitHub Desktop.

Naming

  1. Use PascalCase for the names of Types, Enums, Interfaces, Scalars, and Unions and Input Types.
  2. Use camelCase for Field names, Argument names, and Directive names.
  3. Use SNAKE_CASE for Enum values.
  4. Use the suffix "Input" for Input types. (this caused argument and we ended up dropping it)
  5. Use singular for Type names E.g. User, not Users.. Pet, not Pets
  6. Mutation fields should start with the "action" .. createCustomer, deleteCustomer, etc.
  7. Query and Subscription fields should not start with the "action" .. no "getCustomers" or "getCustomer" .. just "customers" and "customer"
  8. Query and Subscription fields should indicate if a single object or a collection is expected in response "customer" gets one customer. "customers" gets a collection of customer objects.
  9. Any names/identifiers starting with __ (double underscore) are reserved by the GraphQL specification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment