Skip to content
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

Allow identifying apps by API key, not ID #4918

Merged
merged 7 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
import * as Types from './types.js'
import {JsonMapType} from '@shopify/cli-kit/node/toml'

import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core'

export type ActiveAppReleaseFromApiKeyQueryVariables = Types.Exact<{
apiKey: Types.Scalars['String']['input']
}>

export type ActiveAppReleaseFromApiKeyQuery = {
app: {
id: string
key: string
activeRoot: {clientCredentials: {secrets: {key: string}[]}}
activeRelease: {
id: string
version: {
name: string
appModules: {
uuid: string
userIdentifier: string
handle: string
config: JsonMapType
specification: {identifier: string; externalIdentifier: string; name: string}
}[]
}
}
}
}

export const ActiveAppReleaseFromApiKey = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: {kind: 'Name', value: 'ActiveAppReleaseFromApiKey'},
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'apiKey'}},
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
alias: {kind: 'Name', value: 'app'},
name: {kind: 'Name', value: 'appByKey'},
arguments: [
{
kind: 'Argument',
name: {kind: 'Name', value: 'key'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'apiKey'}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'FragmentSpread', name: {kind: 'Name', value: 'AppVersionInfo'}},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
],
},
},
{
kind: 'FragmentDefinition',
name: {kind: 'Name', value: 'ReleasedAppModule'},
typeCondition: {kind: 'NamedType', name: {kind: 'Name', value: 'AppModule'}},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'uuid'}},
{kind: 'Field', name: {kind: 'Name', value: 'userIdentifier'}},
{kind: 'Field', name: {kind: 'Name', value: 'handle'}},
{kind: 'Field', name: {kind: 'Name', value: 'config'}},
{
kind: 'Field',
name: {kind: 'Name', value: 'specification'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'identifier'}},
{kind: 'Field', name: {kind: 'Name', value: 'externalIdentifier'}},
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
],
},
},
],
},
},
{
kind: 'FragmentDefinition',
name: {kind: 'Name', value: 'AppVersionInfo'},
typeCondition: {kind: 'NamedType', name: {kind: 'Name', value: 'App'}},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'id'}},
{kind: 'Field', name: {kind: 'Name', value: 'key'}},
{
kind: 'Field',
name: {kind: 'Name', value: 'activeRoot'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'clientCredentials'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'secrets'},
selectionSet: {
kind: 'SelectionSet',
selections: [{kind: 'Field', name: {kind: 'Name', value: 'key'}}],
},
},
],
},
},
],
},
},
{
kind: 'Field',
name: {kind: 'Name', value: 'activeRelease'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'id'}},
{
kind: 'Field',
name: {kind: 'Name', value: 'version'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
{
kind: 'Field',
name: {kind: 'Name', value: 'appModules'},
selectionSet: {
kind: 'SelectionSet',
selections: [{kind: 'FragmentSpread', name: {kind: 'Name', value: 'ReleasedAppModule'}}],
},
},
],
},
},
],
},
},
],
},
},
],
} as unknown as DocumentNode<ActiveAppReleaseFromApiKeyQuery, ActiveAppReleaseFromApiKeyQueryVariables>
Loading
Loading