From 3a4af7097b200d694179cf4d4d8e800c0d5cdb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isaac=20Rold=C3=A1n?= Date: Thu, 16 Jul 2026 16:19:41 +0200 Subject: [PATCH] Trim dead partners-era GraphQL consts and cli-kit helper Final step of the PartnersClient cleanup. The PartnersClient methods removed earlier in the stack were the only users of these GraphQL query/mutation constants and of the generateFetchAppLogUrl cli-kit helper. Drop the dead constants from the shared query files (keeping the schema/variables types still used by AppManagementClient and other live code), remove generateFetchAppLogUrl, and prune the now-inert no-inline-graphql allowlist entries. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../all_app_extension_registrations.ts | 55 ------------------ .../app/src/cli/api/graphql/app_deploy.ts | 48 ---------------- .../app/src/cli/api/graphql/app_release.ts | 25 -------- .../src/cli/api/graphql/app_versions_diff.ts | 44 -------------- .../api/graphql/extension_specifications.ts | 57 ------------------- .../src/cli/api/graphql/get_versions_list.ts | 30 ---------- .../app/src/cli/api/graphql/update_urls.ts | 20 ------- .../services/webhook/request-api-versions.ts | 6 -- .../cli/services/webhook/request-sample.ts | 14 ----- .../cli/services/webhook/request-topics.ts | 6 -- .../cli-kit/src/public/node/api/partners.ts | 13 ----- .../rules/no-inline-graphql.js | 12 ---- 12 files changed, 330 deletions(-) diff --git a/packages/app/src/cli/api/graphql/all_app_extension_registrations.ts b/packages/app/src/cli/api/graphql/all_app_extension_registrations.ts index 1946ceee391..0a11fb6348a 100644 --- a/packages/app/src/cli/api/graphql/all_app_extension_registrations.ts +++ b/packages/app/src/cli/api/graphql/all_app_extension_registrations.ts @@ -1,58 +1,3 @@ -import {gql} from 'graphql-request' - -export const AllAppExtensionRegistrationsQuery = gql` - query allAppExtensionRegistrations($apiKey: String!) { - app(apiKey: $apiKey) { - extensionRegistrations { - id - uuid - title - type - draftVersion { - config - context - } - activeVersion { - config - context - } - } - configurationRegistrations { - id - uuid - title - type - draftVersion { - config - context - } - activeVersion { - config - context - } - } - dashboardManagedExtensionRegistrations { - id - uuid - title - type - activeVersion { - config - context - } - draftVersion { - config - context - } - } - } - } -` - -export interface AllAppExtensionRegistrationsQueryVariables { - apiKey: string -} - export interface ExtensionRegistration { id: string uid?: string diff --git a/packages/app/src/cli/api/graphql/app_deploy.ts b/packages/app/src/cli/api/graphql/app_deploy.ts index 454f4cc9891..cc6557b986b 100644 --- a/packages/app/src/cli/api/graphql/app_deploy.ts +++ b/packages/app/src/cli/api/graphql/app_deploy.ts @@ -1,52 +1,4 @@ import {UserError} from '../../utilities/developer-platform-client.js' -import {gql} from 'graphql-request' - -// eslint-disable-next-line @shopify/cli/no-inline-graphql -export const AppDeploy = gql` - mutation AppDeploy( - $apiKey: String! - $bundleUrl: String - $appModules: [AppModuleSettings!] - $skipPublish: Boolean - $message: String - $versionTag: String - $commitReference: String - ) { - appDeploy( - input: { - apiKey: $apiKey - bundleUrl: $bundleUrl - appModules: $appModules - skipPublish: $skipPublish - message: $message - versionTag: $versionTag - commitReference: $commitReference - } - ) { - appVersion { - uuid - id - message - versionTag - location - appModuleVersions { - uuid - registrationUuid - validationErrors { - message - field - } - } - } - userErrors { - message - field - category - details - } - } - } -` export interface AppModuleSettings { uid?: string diff --git a/packages/app/src/cli/api/graphql/app_release.ts b/packages/app/src/cli/api/graphql/app_release.ts index a38f288f5d9..77054875753 100644 --- a/packages/app/src/cli/api/graphql/app_release.ts +++ b/packages/app/src/cli/api/graphql/app_release.ts @@ -1,29 +1,4 @@ import {UserError} from '../../utilities/developer-platform-client.js' -import {gql} from 'graphql-request' -// eslint-disable-next-line @shopify/cli/no-inline-graphql -export const AppRelease = gql` - mutation AppRelease($apiKey: String!, $appVersionId: ID, $versionTag: String) { - appRelease(input: {apiKey: $apiKey, appVersionId: $appVersionId, versionTag: $versionTag}) { - appVersion { - versionTag - message - location - } - userErrors { - message - field - category - details - } - } - } -` - -export interface AppReleaseVariables { - apiKey: string - versionTag?: string - appVersionId?: number -} export interface AppReleaseSchema { appRelease: { diff --git a/packages/app/src/cli/api/graphql/app_versions_diff.ts b/packages/app/src/cli/api/graphql/app_versions_diff.ts index ed8d07437a8..fc284b41f9b 100644 --- a/packages/app/src/cli/api/graphql/app_versions_diff.ts +++ b/packages/app/src/cli/api/graphql/app_versions_diff.ts @@ -1,47 +1,3 @@ -import {gql} from 'graphql-request' - -export const AppVersionsDiffQuery = gql` - query AppVersionsDiff($apiKey: String!, $versionId: ID!) { - app(apiKey: $apiKey) { - versionsDiff(appVersionId: $versionId) { - added { - uuid - registrationTitle - specification { - identifier - experience - options { - managementExperience - } - } - } - updated { - uuid - registrationTitle - specification { - identifier - experience - options { - managementExperience - } - } - } - removed { - uuid - registrationTitle - specification { - identifier - experience - options { - managementExperience - } - } - } - } - } - } -` - export interface AppVersionsDiffExtensionSchema { uuid: string registrationTitle: string diff --git a/packages/app/src/cli/api/graphql/extension_specifications.ts b/packages/app/src/cli/api/graphql/extension_specifications.ts index a2108617ab6..679786eb552 100644 --- a/packages/app/src/cli/api/graphql/extension_specifications.ts +++ b/packages/app/src/cli/api/graphql/extension_specifications.ts @@ -1,35 +1,3 @@ -import {gql} from 'graphql-request' - -// eslint-disable-next-line @shopify/cli/no-inline-graphql -export const ExtensionSpecificationsQuery = gql` - query fetchSpecifications($apiKey: String!) { - extensionSpecifications(apiKey: $apiKey) { - name - externalName - externalIdentifier - identifier - gated - experience - options { - managementExperience - registrationLimit - } - features { - argo { - surface - } - } - validationSchema { - jsonSchema - } - } - } -` - -export interface ExtensionSpecificationsQueryVariables { - apiKey: string -} - export interface RemoteSpecification { name: string externalName: string @@ -45,28 +13,3 @@ export interface RemoteSpecification { jsonSchema: string } | null } - -interface PartnersRemoteSpecification { - name: string - externalName: string - identifier: string - gated: boolean - externalIdentifier: string - experience: 'extension' | 'configuration' | 'deprecated' - options: { - managementExperience: 'cli' | 'custom' | 'dashboard' - registrationLimit: number - } - features?: { - argo?: { - surface: string - } - } - validationSchema?: { - jsonSchema: string - } | null -} - -export interface ExtensionSpecificationsQuerySchema { - extensionSpecifications: PartnersRemoteSpecification[] -} diff --git a/packages/app/src/cli/api/graphql/get_versions_list.ts b/packages/app/src/cli/api/graphql/get_versions_list.ts index 5a8ebcc8cb7..d01150892c0 100644 --- a/packages/app/src/cli/api/graphql/get_versions_list.ts +++ b/packages/app/src/cli/api/graphql/get_versions_list.ts @@ -1,33 +1,3 @@ -import {gql} from 'graphql-request' - -export const AppVersionsQuery = gql` - query AppVersionsQuery($apiKey: String!) { - app(apiKey: $apiKey) { - id - organizationId - title - appVersions { - nodes { - createdAt - createdBy { - displayName - } - message - status - versionTag - } - pageInfo { - totalResults - } - } - } - } -` - -export interface AppVersionsQueryVariables { - apiKey: string -} - export interface AppVersionsQuerySchema { app: { id: string diff --git a/packages/app/src/cli/api/graphql/update_urls.ts b/packages/app/src/cli/api/graphql/update_urls.ts index 085400bc552..d3b64906767 100644 --- a/packages/app/src/cli/api/graphql/update_urls.ts +++ b/packages/app/src/cli/api/graphql/update_urls.ts @@ -1,23 +1,3 @@ -import {gql} from 'graphql-request' - -export const UpdateURLsQuery = gql` - mutation appUpdate($apiKey: String!, $applicationUrl: Url!, $redirectUrlWhitelist: [Url]!, $appProxy: AppProxyInput) { - appUpdate( - input: { - apiKey: $apiKey - applicationUrl: $applicationUrl - redirectUrlWhitelist: $redirectUrlWhitelist - appProxy: $appProxy - } - ) { - userErrors { - message - field - } - } - } -` - export interface UpdateURLsVariables { apiKey: string applicationUrl: string diff --git a/packages/app/src/cli/services/webhook/request-api-versions.ts b/packages/app/src/cli/services/webhook/request-api-versions.ts index 0a0d1eb9304..79f2c083d3f 100644 --- a/packages/app/src/cli/services/webhook/request-api-versions.ts +++ b/packages/app/src/cli/services/webhook/request-api-versions.ts @@ -4,12 +4,6 @@ export interface PublicApiVersionsSchema { publicApiVersions: string[] } -export const GetApiVersionsQuery = ` - query getApiVersions { - publicApiVersions - } -` - /** * Requests available api-versions in order to validate flags or present a list of options * diff --git a/packages/app/src/cli/services/webhook/request-sample.ts b/packages/app/src/cli/services/webhook/request-sample.ts index b6c6ab813c5..460d3802b01 100644 --- a/packages/app/src/cli/services/webhook/request-sample.ts +++ b/packages/app/src/cli/services/webhook/request-sample.ts @@ -25,20 +25,6 @@ export interface UserErrors { fields: string[] } -// eslint-disable-next-line @shopify/cli/no-inline-graphql -export const sendSampleWebhookMutation = ` - mutation samplePayload($topic: String!, $api_version: String!, $address: String!, $delivery_method: String!, $shared_secret: String!, $api_key: String) { - sendSampleWebhook(input: {topic: $topic, apiVersion: $api_version, address: $address, deliveryMethod: $delivery_method, sharedSecret: $shared_secret, apiKey: $api_key}) { - samplePayload - success - headers - userErrors { - message - } - } - } -` - /** * Request the sample to partners. Partners will call core and the webhook will be emitted * In case the deliveryMethod is localhost and address is local, the response comes with the data the plugin diff --git a/packages/app/src/cli/services/webhook/request-topics.ts b/packages/app/src/cli/services/webhook/request-topics.ts index f93a162e3a7..f66a47b45be 100644 --- a/packages/app/src/cli/services/webhook/request-topics.ts +++ b/packages/app/src/cli/services/webhook/request-topics.ts @@ -8,12 +8,6 @@ export interface WebhookTopicsSchema { webhookTopics: string[] } -export const getTopicsQuery = ` - query getWebhookTopics($api_version: String!) { - webhookTopics(apiVersion: $api_version) - } -` - /** * Requests topics for an api-version in order to validate flags or present a list of options * diff --git a/packages/cli-kit/src/public/node/api/partners.ts b/packages/cli-kit/src/public/node/api/partners.ts index bb1f00766a1..1d952ccf23a 100644 --- a/packages/cli-kit/src/public/node/api/partners.ts +++ b/packages/cli-kit/src/public/node/api/partners.ts @@ -1,4 +1,3 @@ -import {addCursorAndFiltersToAppLogsUrl} from './utilities.js' import { graphqlRequest, GraphQLVariables, @@ -78,18 +77,6 @@ export async function partnersRequest( return result } -export const generateFetchAppLogUrl = async ( - cursor?: string, - filters?: { - status?: string - source?: string - }, -): Promise => { - const fqdn = await partnersFqdn() - const url = `https://${fqdn}/app_logs/poll` - return addCursorAndFiltersToAppLogsUrl(url, cursor, filters) -} - /** * Executes a GraphQL query against the Partners API. Uses typed documents. * diff --git a/packages/eslint-plugin-cli/rules/no-inline-graphql.js b/packages/eslint-plugin-cli/rules/no-inline-graphql.js index 6208a6d1c9b..6184e3edbf6 100644 --- a/packages/eslint-plugin-cli/rules/no-inline-graphql.js +++ b/packages/eslint-plugin-cli/rules/no-inline-graphql.js @@ -116,13 +116,8 @@ module.exports = { } const knownFailures = { - 'packages/app/src/cli/api/graphql/all_app_extension_registrations.ts': - 'bbde8b08d13bdeeab3d586ffd76c75cfea31c5891ac9a0f957a7a273d520e9e2', 'packages/app/src/cli/api/graphql/all_dev_stores_by_org.ts': 'f48a44e2dae39f1b33ac685971740e3705f2754de5fdf1d6f1fbb3492bc62be2', - 'packages/app/src/cli/api/graphql/app_release.ts': '3acace031157856c88dc57506d81364c084fb5ca66ab5c6ff59393ab5255846d', - 'packages/app/src/cli/api/graphql/app_versions_diff.ts': - '233e2abb837d4cad52e985b373784314129163bf530a6caa501af2b711717b09', 'packages/app/src/cli/api/graphql/convert_dev_to_transfer_disabled_store.ts': '0261459f988f5ba947ba52dc90dd049032196595cad5be8b7042ad1d0a22277c', 'packages/app/src/cli/api/graphql/current_account_info.ts': @@ -137,17 +132,10 @@ const knownFailures = { '812944a456b2ae439ebb01a97c19e3e0c445157dd3578bc48b0a8c4cebb6e12e', 'packages/app/src/cli/api/graphql/extension_migrate_to_ui_extension.ts': 'dd3fb42d0b9327de627bd02295de9e08087266885777602a34b44bdc460c0285', - 'packages/app/src/cli/api/graphql/extension_specifications.ts': - '9a3dff21a92b5910a29f4893faef35a549a08f5675f67407cc415b10ba7091a3', 'packages/app/src/cli/api/graphql/find_app_preview_mode.ts': '8311925b338d4aba1957974bb815cfa8c5d8272226f68b8e74a69d91acc9c8cb', 'packages/app/src/cli/api/graphql/get_variant_id.ts': '805a7d8fb4b66ae23dc45cc37d401350c3d8eab4e262bd90e70afceb48be10de', - 'packages/app/src/cli/api/graphql/get_versions_list.ts': - '36b6f90c6687ba50b84b31de9fa28b4e9d0cadb732cab6c0d83664b627f2969d', - 'packages/app/src/cli/api/graphql/update_urls.ts': '37d20c418982a4bc4eed047ec48f52d93be1a0e59f1d905911b8519ab3adb5a4', - 'packages/app/src/cli/services/webhook/request-sample.ts': - '05dd159152c528d7e785ef3476f6dbfca0be25046ce06584d5fd2ea89a23ed16', 'packages/app/src/cli/utilities/developer-platform-client/app-management-client/graphql/active-app-release.ts': 'e1998153a015f9a7bb392aab6788a10a9afe76220eeb4515e958e679ec667ed1', 'packages/app/src/cli/utilities/developer-platform-client/app-management-client/graphql/app-version-by-id.ts':