Skip to content

Conversation

@danstarns
Copy link
Contributor

Was going back and forth wondering why my function was not being exposed via the graphql mutations api, turns out its a hardcoded convention in the codebase located here:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds documentation for GraphQL mutation naming conventions, outlining how exported functions are classified based on their name prefixes.

  • Introduces a new Generating Mutations section in the API guide.
  • Lists the exact prefixes that trigger mutation generation.
  • Provides examples contrasting query vs. mutation naming.
Comments suppressed due to low confidence (1)

modus/api-generation.mdx:146

  • Clarify whether the prefix matching is case-sensitive or case-insensitive so users know if variants like AddUser vs addUser are both recognized as mutations.
Functions are automatically classified as **mutations** when they start with these prefixes:

@trunk-io
Copy link

trunk-io bot commented May 29, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

@ryanfoxtyler ryanfoxtyler merged commit af32ac3 into main May 29, 2025
7 checks passed
@ryanfoxtyler ryanfoxtyler deleted the mutation-conventions branch May 29, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants