Skip to content

Refactor command name handling for back end queries #9314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2025
Merged

Conversation

mtsgrd
Copy link
Contributor

@mtsgrd mtsgrd commented Jul 8, 2025

In order to better capture metrics we need the backend command name to
be defined on the rtkq queries directly, rather than as part of the
arguments to the base query.

What would be ideal is if we could modify the MutationDefintion to
have the extra properties directly, rather than constantly nesting them
inside extraOptions.

For now I am leaving build.query() definitions alone, and reliant on
passing command through the query args. Before we migrate them over we
need to implement the posthog stuff on the query hooks (the ones touched
here are all mutations).

Copy link

vercel bot commented Jul 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 8:51pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
gitbutler-web ⬜️ Skipped (Inspect) Jul 8, 2025 8:51pm

Comment on lines +56 to 58
query: ({ projectId, changes }) => ({
params: { projectId, changes }
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All these kinds of arguments can be reduced to (x)=>x once all the build.query() endpoints have been updated to use extraOptions.

README.md Outdated
@@ -1,3 +1,5 @@
Hello
Copy link
Member

Choose a reason for hiding this comment

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

Hi :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😂

In order to better capture metrics we need the backend command name to 
be defined on the rtkq queries directly, rather than as part of the 
arguments to the base query.

What would be ideal is if we could modify the `MutationDefintion` to 
have the extra properties directly, rather than constantly nesting them 
inside `extraOptions`.

For now I am leaving `build.query()` definitions alone, and reliant on 
passing `command` through the query args. Before we migrate them over we
need to implement the posthog stuff on the query hooks (the ones touched
here are all mutations).
@vercel vercel bot temporarily deployed to Preview – gitbutler-web July 8, 2025 20:50 Inactive
@mtsgrd mtsgrd enabled auto-merge (rebase) July 8, 2025 20:52
@mtsgrd mtsgrd merged commit 43e7c13 into master Jul 8, 2025
20 checks passed
@mtsgrd mtsgrd deleted the command-name branch July 8, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants