@@ -16,15 +16,15 @@ import {
1616import * as TargetInput from '../../helpers/target-input' ;
1717import { Texture } from '../../helpers/texture/texture' ;
1818
19- const SchemaVersionForActionIdQuery = graphql ( /* GraphQL */ `
20- query SchemaVersionForActionId (
21- $actionId: ID !
19+ const SchemaVersionByCommitQuery = graphql ( /* GraphQL */ `
20+ query SchemaVersionByCommit (
21+ $commit: String !
2222 $includeSDL: Boolean!
2323 $includeSupergraph: Boolean!
2424 $includeSubgraphs: Boolean!
2525 $target: TargetReferenceInput
2626 ) {
27- schemaVersionForActionId(actionId : $actionId , target: $target) {
27+ schemaVersionByCommit(commit : $commit , target: $target) {
2828 id
2929 isValid
3030 sdl @include(if: $includeSDL)
@@ -128,9 +128,9 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
128128 } ;
129129
130130 static args = {
131- actionId : Args . string ( {
132- name : 'actionId ' as const ,
133- description : 'action id (e.g. commit sha) ' ,
131+ commit : Args . string ( {
132+ name : 'commit ' as const ,
133+ description : 'commit SHA, or it can be any external ID that references the schema ' ,
134134 hidden : false ,
135135 } ) ,
136136 } ;
@@ -163,7 +163,7 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
163163 throw new MissingRegistryTokenError ( ) ;
164164 }
165165
166- const { actionId } = args ;
166+ const { commit } = args ;
167167
168168 const sdlType = this . ensure ( {
169169 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -185,18 +185,18 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
185185 }
186186
187187 let schemaVersion ;
188- if ( actionId ) {
188+ if ( commit ) {
189189 const result = await this . registryApi ( endpoint , accessToken ) . request ( {
190- operation : SchemaVersionForActionIdQuery ,
190+ operation : SchemaVersionByCommitQuery ,
191191 variables : {
192- actionId ,
192+ commit ,
193193 includeSDL : sdlType === 'sdl' ,
194194 includeSupergraph : sdlType === 'supergraph' ,
195195 includeSubgraphs : sdlType === 'subgraphs' ,
196196 target,
197197 } ,
198198 } ) ;
199- schemaVersion = result . schemaVersionForActionId ;
199+ schemaVersion = result . schemaVersionByCommit ;
200200 } else {
201201 const result = await this . registryApi ( endpoint , accessToken ) . request ( {
202202 operation : LatestSchemaVersionQuery ,
@@ -211,11 +211,11 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
211211 }
212212
213213 if ( schemaVersion == null ) {
214- throw new SchemaNotFoundError ( actionId ) ;
214+ throw new SchemaNotFoundError ( commit ) ;
215215 }
216216
217217 if ( schemaVersion . isValid === false ) {
218- throw new InvalidSchemaError ( actionId ) ;
218+ throw new InvalidSchemaError ( commit ) ;
219219 }
220220
221221 if ( schemaVersion . schemas ) {
@@ -239,7 +239,7 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
239239 const schema = schemaVersion . sdl ?? schemaVersion . supergraph ;
240240
241241 if ( schema == null ) {
242- throw new SchemaNotFoundError ( actionId ) ;
242+ throw new SchemaNotFoundError ( commit ) ;
243243 }
244244
245245 if ( flags . write ) {
0 commit comments