Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ packages/ui-extensions-dev-console/css-transform.js
packages/ui-extensions-dev-console/dist
packages/cli-kit/src/cli/api/graphql/*/*_schema.graphql
packages/organizations/src/cli/api/graphql/*/*_schema.graphql
packages/store/src/cli/api/graphql/*/*_schema.graphql

.claude/settings.local.json

Expand Down
6 changes: 5 additions & 1 deletion bin/get-graphql-schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ const schemas = [
localPaths: [
'./packages/app/src/cli/api/graphql/business-platform-destinations/destinations_schema.graphql',
'./packages/organizations/src/cli/api/graphql/business-platform-destinations/destinations_schema.graphql',
'./packages/store/src/cli/api/graphql/business-platform-destinations/destinations_schema.graphql',
],
},
{
owner: 'shop',
repo: 'world',
pathToFile: 'areas/platforms/organizations/db/graphql/organizations_schema.graphql',
localPaths: ['./packages/app/src/cli/api/graphql/business-platform-organizations/organizations_schema.graphql'],
localPaths: [
'./packages/app/src/cli/api/graphql/business-platform-organizations/organizations_schema.graphql',
'./packages/store/src/cli/api/graphql/business-platform-organizations/organizations_schema.graphql',
],
},
{
owner: 'shop',
Expand Down
2 changes: 2 additions & 0 deletions graphql.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@ export default {
functions: projectFactory('functions', 'functions_cli_schema.graphql', 'app'),
adminAsApp: projectFactory('admin', 'admin_schema.graphql'),
organizationsDestinations: projectFactory('business-platform-destinations', 'destinations_schema.graphql', 'organizations'),
storeBusinessPlatformDestinations: projectFactory('business-platform-destinations', 'destinations_schema.graphql', 'store'),
storeBusinessPlatformOrganizations: projectFactory('business-platform-organizations', 'organizations_schema.graphql', 'store'),
},
}
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,24 @@
]
}
},
"packages/store": {
"entry": [
"**/{commands,hooks}/**/*.ts!",
"**/index.ts!"
],
"project": "**/*.ts!",
"ignore": [
"**/graphql/**/generated/*.ts"
],
"ignoreDependencies": [
"@graphql-typed-document-node/core"
],
"vite": {
"config": [
"vite.config.ts"
]
}
},
"packages/cli": {
"entry": [
"**/{commands,hooks}/**/*.ts!",
Expand Down
1 change: 1 addition & 0 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
]
},
"dependencies": {
"@graphql-typed-document-node/core": "3.2.0",
"@oclif/core": "4.11.4",
"@shopify/cli-kit": "4.1.0"
},
Expand Down
63 changes: 63 additions & 0 deletions packages/store/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,69 @@
"command": "pnpm tsc --noEmit",
"cwd": "packages/store"
}
},
"graphql-codegen": {
"executor": "nx:noop",
"dependsOn": ["graphql-codegen:formatting"]
},
"graphql-codegen:formatting": {
"executor": "nx:run-commands",
"dependsOn": ["graphql-codegen:postfix"],
"inputs": [{"dependentTasksOutputFiles": "**/*.ts"}],
"outputs": [
"{projectRoot}/src/cli/api/graphql/business-platform-destinations/generated/**/*.ts",
"{projectRoot}/src/cli/api/graphql/business-platform-organizations/generated/**/*.ts"
],
"options": {
"commands": [
"pnpm eslint 'src/cli/api/graphql/business-platform-destinations/generated/**/*.{ts,tsx}' --fix",
"pnpm eslint 'src/cli/api/graphql/business-platform-organizations/generated/**/*.{ts,tsx}' --fix"
],
"cwd": "packages/store"
}
},
"graphql-codegen:generate:business-platform-destinations": {
"executor": "nx:run-commands",
"inputs": [
"{workspaceRoot}/graphql.config.ts",
"{projectRoot}/src/cli/api/graphql/business-platform-destinations/**/*.graphql"
],
"outputs": ["{projectRoot}/src/cli/api/graphql/business-platform-destinations/generated/**/*.ts"],
"options": {
"commands": ["pnpm exec graphql-codegen --project=storeBusinessPlatformDestinations"],
"cwd": "{workspaceRoot}"
}
},
"graphql-codegen:generate:business-platform-organizations": {
"executor": "nx:run-commands",
"inputs": [
"{workspaceRoot}/graphql.config.ts",
"{projectRoot}/src/cli/api/graphql/business-platform-organizations/**/*.graphql"
],
"outputs": ["{projectRoot}/src/cli/api/graphql/business-platform-organizations/generated/**/*.ts"],
"options": {
"commands": ["pnpm exec graphql-codegen --project=storeBusinessPlatformOrganizations"],
"cwd": "{workspaceRoot}"
}
},
"graphql-codegen:postfix": {
"executor": "nx:run-commands",
"dependsOn": [
"graphql-codegen:generate:business-platform-destinations",
"graphql-codegen:generate:business-platform-organizations"
],
"inputs": [{"dependentTasksOutputFiles": "**/*.ts"}],
"outputs": [
"{projectRoot}/src/cli/api/graphql/business-platform-destinations/generated/**/*.ts",
"{projectRoot}/src/cli/api/graphql/business-platform-organizations/generated/**/*.ts"
],
"options": {
"commands": [
"find ./packages/store/src/cli/api/graphql/business-platform-destinations/generated/ -type f -name '*.ts' -exec sh -c 'sed -i \"\" \"s|import \\* as Types from '\\''./types'\\'';|import \\* as Types from '\\''./types.js'\\'';|g; s|export const \\([A-Za-z0-9_]*\\)Document =|export const \\1 =|g\" \"$0\"' {} \\;",
"find ./packages/store/src/cli/api/graphql/business-platform-organizations/generated/ -type f -name '*.ts' -exec sh -c 'sed -i \"\" \"s|import \\* as Types from '\\''./types'\\'';|import \\* as Types from '\\''./types.js'\\'';|g; s|export const \\([A-Za-z0-9_]*\\)Document =|export const \\1 =|g\" \"$0\"' {} \\;"
],
"cwd": "{workspaceRoot}"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
import * as Types from './types.js'

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

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

export type StoreInfoDestinationsQuery = {
currentUserAccount?: {
destinations: {nodes: {publicId: unknown; primaryDomain?: string | null; webUrl: string}[]}
} | null
}

export const StoreInfoDestinations = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: {kind: 'Name', value: 'StoreInfoDestinations'},
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'search'}},
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'currentUserAccount'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'destinations'},
arguments: [
{
kind: 'Argument',
name: {kind: 'Name', value: 'search'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'search'}},
},
{
kind: 'Argument',
name: {kind: 'Name', value: 'shopsOnly'},
value: {kind: 'BooleanValue', value: true},
},
{kind: 'Argument', name: {kind: 'Name', value: 'first'}, value: {kind: 'IntValue', value: '25'}},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'nodes'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'publicId'}},
{kind: 'Field', name: {kind: 'Name', value: 'primaryDomain'}},
{kind: 'Field', name: {kind: 'Name', value: 'webUrl'}},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
],
},
},
],
} as unknown as DocumentNode<StoreInfoDestinationsQuery, StoreInfoDestinationsQueryVariables>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
import * as Types from './types.js'

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

export type StoreInfoOwningOrgQueryVariables = Types.Exact<{
destinationPublicId: Types.Scalars['DestinationPublicID']['input']
}>

export type StoreInfoOwningOrgQuery = {
currentUserAccount?: {organizationForDestination?: {id: string; name: string} | null} | null
}

export const StoreInfoOwningOrg = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: {kind: 'Name', value: 'StoreInfoOwningOrg'},
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'destinationPublicId'}},
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'DestinationPublicID'}}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'currentUserAccount'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'organizationForDestination'},
arguments: [
{
kind: 'Argument',
name: {kind: 'Name', value: 'destinationPublicId'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'destinationPublicId'}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'id'}},
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
],
},
},
],
} as unknown as DocumentNode<StoreInfoOwningOrgQuery, StoreInfoOwningOrgQueryVariables>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any, tsdoc/syntax, @typescript-eslint/no-duplicate-type-constituents, @typescript-eslint/no-redundant-type-constituents, @nx/enforce-module-boundaries */
import {JsonMapType} from '@shopify/cli-kit/node/toml'
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: { input: string; output: string; }
String: { input: string; output: string; }
Boolean: { input: boolean; output: boolean; }
Int: { input: number; output: number; }
Float: { input: number; output: number; }
DestinationID: { input: any; output: any; }
DestinationPublicID: { input: any; output: any; }
GlobalID: { input: string; output: string; }
/** An ISO 8601-encoded datetime */
ISO8601DateTime: { input: any; output: any; }
/** The ID for a Organization. */
OrganizationID: { input: any; output: any; }
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
query StoreInfoDestinations($search: String!) {
currentUserAccount {
destinations(search: $search, shopsOnly: true, first: 25) {
nodes {
publicId
primaryDomain
webUrl
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
query StoreInfoOwningOrg($destinationPublicId: DestinationPublicID!) {
currentUserAccount {
organizationForDestination(destinationPublicId: $destinationPublicId) {
id
name
}
}
}
Loading
Loading