Skip to content

Use the Flaps app lookup instead of the full GraphQL GetApp query - #5181

Merged
lillianberryfly merged 3 commits into
masterfrom
lillian/trim-graphql-get-app
Sep 8, 2026
Merged

Use the Flaps app lookup instead of the full GraphQL GetApp query#5181
lillianberryfly merged 3 commits into
masterfrom
lillian/trim-graphql-get-app

Conversation

@lillianberryfly

Copy link
Copy Markdown
Contributor

The fly-go GetApp GraphQL query fetches every field on an app, including the full config of every machine, but the flyctl callers only read the app name, the organization slug, and the internal numeric ID. All of those are returned by the Flaps GET /apps/{name} endpoint, which flyctl already calls elsewhere.

Switch apps destroy, apps move, mcp destroy, the launch existence check, and the Tigris statics deployer to the Flaps app. The statics package now takes a *flaps.App, and MoveBucket takes the release version explicitly; apps move fetches it with the small current-release query only when there is a bucket to move.

apps move no longer goes through App.Compact() to build the agent tunnel. That copy never carried the app network because the GraphQL query did not fetch it, so apps on custom networks now dial correctly.

The only remaining caller of the full query is apps create --json, which renders the whole struct as output.

Claude-Session: https://claude.ai/code/session_01DMttEkUAVhL7YZFRFjhHwB

lillianberryfly and others added 2 commits September 8, 2026 14:53
The fly-go GetApp GraphQL query fetches every field on an app, including
the full config of every machine, but the flyctl callers only read the
app name, the organization slug, and the internal numeric ID. All of
those are returned by the Flaps GET /apps/{name} endpoint, which flyctl
already calls elsewhere.

Switch `apps destroy`, `apps move`, `mcp destroy`, the launch existence
check, and the Tigris statics deployer to the Flaps app. The statics
package now takes a *flaps.App, and MoveBucket takes the release version
explicitly; `apps move` fetches it with the small current-release query
only when there is a bucket to move.

`apps move` no longer goes through App.Compact() to build the agent
tunnel. That copy never carried the app network because the GraphQL
query did not fetch it, so apps on custom networks now dial correctly.

The only remaining caller of the full query is `apps create --json`,
which renders the whole struct as output.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMttEkUAVhL7YZFRFjhHwB
Flaps reports an organization's default network as "default", while the
web API and the WireGuard peer mutation identify it by an empty name.
Passing the Flaps value straight into the agent tunnel failed with
"is not a valid network for organization" for every app on the default
network. Add flapsutil.NetworkName to translate it, and BuildContextForApp
to apply that for apps fetched through Flaps.

Flaps also reports the raw org slug rather than the "personal" alias, so
the no-op check in apps move now compares against both.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMttEkUAVhL7YZFRFjhHwB
@lillianberryfly
lillianberryfly force-pushed the lillian/trim-graphql-get-app branch from 7fe0eb8 to 7e5cedd Compare September 8, 2026 14:55
Flaps reports the personal organization by its raw slug while the
GraphQL API and the agent's tunnel keys use the "personal" alias, so a
client that dialed with the Flaps slug got "no such organization". The
agent now matches either slug when establishing a tunnel and remembers
the alias, so later lookups that carry only the slug the client used
find the same tunnel.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMttEkUAVhL7YZFRFjhHwB
@lillianberryfly
lillianberryfly merged commit 6619ad8 into master Sep 8, 2026
24 checks passed
@lillianberryfly
lillianberryfly deleted the lillian/trim-graphql-get-app branch September 8, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant