From 596ccf8ee3b3bc6dcfe2cb8216d8d92ad28b5ea0 Mon Sep 17 00:00:00 2001 From: Kristaps Fabians Geikins Date: Tue, 3 Sep 2024 10:59:16 +0300 Subject: [PATCH] feat(fe2): greatly improved DX for apollo cache modification (#2831) * proof of concept - types work * WIP * wipp * new modifyObjectFieldf * updatePathIfExists * wipp * working? * projects dashboard test * more improvements * more improvements * fixx * bugfix * minor fixes and cleanup * moar cleanup * autoEvictFiltered --- packages/frontend-2/codegen.ts | 2 +- .../components/projects/Dashboard.vue | 45 +- .../lib/common/composables/graphql.ts | 2 +- .../lib/common/generated/gql/graphql.ts | 1393 ++++++++++++++++- .../frontend-2/lib/common/helpers/graphql.ts | 365 ++++- .../lib/workspaces/composables/management.ts | 50 +- packages/frontend-2/package.json | 5 +- .../tools/gqlCacheHelpersCodegenPlugin.js | 59 + yarn.lock | 47 +- 9 files changed, 1816 insertions(+), 152 deletions(-) create mode 100644 packages/frontend-2/tools/gqlCacheHelpersCodegenPlugin.js diff --git a/packages/frontend-2/codegen.ts b/packages/frontend-2/codegen.ts index 38c54e1d0..04279dfe8 100644 --- a/packages/frontend-2/codegen.ts +++ b/packages/frontend-2/codegen.ts @@ -35,7 +35,7 @@ const config: CodegenConfig = { fragmentMasking: false, dedupeFragments: true }, - plugins: [] + plugins: ['./tools/gqlCacheHelpersCodegenPlugin.js'] } } } diff --git a/packages/frontend-2/components/projects/Dashboard.vue b/packages/frontend-2/components/projects/Dashboard.vue index 53376416e..684afd085 100644 --- a/packages/frontend-2/components/projects/Dashboard.vue +++ b/packages/frontend-2/components/projects/Dashboard.vue @@ -68,12 +68,7 @@ import { projectsDashboardWorkspaceQuery } from '~~/lib/projects/graphql/queries' import { graphql } from '~~/lib/common/generated/gql' -import { - getCacheId, - evictObjectFields, - modifyObjectFields -} from '~~/lib/common/helpers/graphql' -import type { User, UserProjectsArgs } from '~~/lib/common/generated/gql/graphql' +import { getCacheId, modifyObjectField } from '~~/lib/common/helpers/graphql' import { UserProjectsUpdatedMessageType } from '~~/lib/common/generated/gql/graphql' import { ToastNotificationType, useGlobalToast } from '~~/lib/common/composables/toast' import { projectRoute } from '~~/lib/common/helpers/route' @@ -171,35 +166,19 @@ onUserProjectsUpdate((res) => { if (isNewProject && incomingProject) { // Add to User.projects where possible - modifyObjectFields( + modifyObjectField( cache, getCacheId('User', activeUserId), - (fieldName, variables, value, { ref }) => { - if (fieldName !== 'projects') return - if (variables.filter?.search?.length) return - if (variables.filter?.onlyWithRoles?.length) { - const roles = variables.filter.onlyWithRoles - if (!roles.includes(incomingProject.role || '')) return - } - - return { - ...value, - items: [ref('Project', incomingProject.id), ...(value.items || [])], - totalCount: (value.totalCount || 0) + 1 - } - } - ) - - // Elsewhere - just evict fields directly - evictObjectFields( - cache, - getCacheId('User', activeUserId), - (fieldName, variables) => { - if (fieldName !== 'projects') return false - if (variables.filter?.search?.length) return true - - return false - } + 'projects', + ({ helpers: { ref, createUpdatedValue } }) => + createUpdatedValue(({ update }) => { + update('items', (items) => [ + ref('Project', incomingProject.id), + ...(items || []) + ]) + update('totalCount', (count) => count + 1) + }), + { autoEvictFiltered: true } ) } diff --git a/packages/frontend-2/lib/common/composables/graphql.ts b/packages/frontend-2/lib/common/composables/graphql.ts index d0d2ef3c0..ad7b01a6f 100644 --- a/packages/frontend-2/lib/common/composables/graphql.ts +++ b/packages/frontend-2/lib/common/composables/graphql.ts @@ -12,7 +12,7 @@ import { useQuery } from '@vue/apollo-composable' import { convertThrowIntoFetchResult } from '~/lib/common/helpers/graphql' import type { InfiniteLoaderState } from '@speckle/ui-components' import { isUndefined } from 'lodash-es' -import type { MaybeNullOrUndefined, Optional } from '@speckle/shared' +import { type MaybeNullOrUndefined, type Optional } from '@speckle/shared' import { useScopedState } from '~/lib/common/composables/scopedState' export const useApolloClientIfAvailable = () => { diff --git a/packages/frontend-2/lib/common/generated/gql/graphql.ts b/packages/frontend-2/lib/common/generated/gql/graphql.ts index bde638807..e359de1e3 100644 --- a/packages/frontend-2/lib/common/generated/gql/graphql.ts +++ b/packages/frontend-2/lib/common/generated/gql/graphql.ts @@ -5947,4 +5947,1395 @@ export const LegacyViewerStreamRedirectMetadataDocument = {"kind":"Document","de export const AutoAcceptableWorkspaceInviteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AutoAcceptableWorkspaceInvite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceInvite"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"token"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"UseWorkspaceInviteManager_PendingWorkspaceCollaborator"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UseWorkspaceInviteManager_PendingWorkspaceCollaborator"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PendingWorkspaceCollaborator"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; export const ResolveCommentLinkDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ResolveCommentLink"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"commentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"comment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"commentId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"LinkableComment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LinkableComment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Comment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"viewerResources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelId"}},{"kind":"Field","name":{"kind":"Name","value":"versionId"}},{"kind":"Field","name":{"kind":"Name","value":"objectId"}}]}}]}}]} as unknown as DocumentNode; export const AutomateFunctionPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AutomateFunctionPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"functionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateFunction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"functionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPage_AutomateFunction"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPageHeader_Function"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPageParametersDialog_AutomateFunctionRelease"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRelease"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPageInfo_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"automationCount"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"commitId"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPageParametersDialog_AutomateFunctionRelease"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isFeatured"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPage_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"supportedSourceApps"}},{"kind":"Field","name":{"kind":"Name","value":"tags"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPageHeader_Function"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPageInfo_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"}},{"kind":"Field","name":{"kind":"Name","value":"creator"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; -export const AutomateFunctionsPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AutomateFunctionsPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"search"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"NullValue"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionsPageItems_Query"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionsPageHeader_Query"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isFeatured"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionCreateDialogTemplateStep_AutomateFunctionTemplate"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionTemplate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionsPageItems_Query"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateFunctions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"20"}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionsPageHeader_Query"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"automateInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasAutomateGithubApp"}},{"kind":"Field","name":{"kind":"Name","value":"availableGithubOrgs"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"serverInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableFunctionTemplates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionCreateDialogTemplateStep_AutomateFunctionTemplate"}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const AutomateFunctionsPageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AutomateFunctionsPage"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"search"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"NullValue"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionsPageItems_Query"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionsPageHeader_Query"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isFeatured"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionCreateDialogTemplateStep_AutomateFunctionTemplate"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionTemplate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionsPageItems_Query"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateFunctions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"20"}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionsPageHeader_Query"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"automateInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasAutomateGithubApp"}},{"kind":"Field","name":{"kind":"Name","value":"availableGithubOrgs"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"serverInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableFunctionTemplates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionCreateDialogTemplateStep_AutomateFunctionTemplate"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export type AllObjectTypes = { + ActiveUserMutations: ActiveUserMutations, + Activity: Activity, + ActivityCollection: ActivityCollection, + AdminInviteList: AdminInviteList, + AdminQueries: AdminQueries, + AdminUserList: AdminUserList, + AdminUserListItem: AdminUserListItem, + AdminUsersListCollection: AdminUsersListCollection, + AdminUsersListItem: AdminUsersListItem, + ApiToken: ApiToken, + AppAuthor: AppAuthor, + AuthStrategy: AuthStrategy, + AutomateFunction: AutomateFunction, + AutomateFunctionCollection: AutomateFunctionCollection, + AutomateFunctionRelease: AutomateFunctionRelease, + AutomateFunctionReleaseCollection: AutomateFunctionReleaseCollection, + AutomateFunctionRun: AutomateFunctionRun, + AutomateFunctionTemplate: AutomateFunctionTemplate, + AutomateMutations: AutomateMutations, + AutomateRun: AutomateRun, + AutomateRunCollection: AutomateRunCollection, + Automation: Automation, + AutomationCollection: AutomationCollection, + AutomationRevision: AutomationRevision, + AutomationRevisionFunction: AutomationRevisionFunction, + AvatarUser: AvatarUser, + BasicGitRepositoryMetadata: BasicGitRepositoryMetadata, + BlobMetadata: BlobMetadata, + BlobMetadataCollection: BlobMetadataCollection, + Branch: Branch, + BranchCollection: BranchCollection, + Comment: Comment, + CommentActivityMessage: CommentActivityMessage, + CommentCollection: CommentCollection, + CommentDataFilters: CommentDataFilters, + CommentMutations: CommentMutations, + CommentReplyAuthorCollection: CommentReplyAuthorCollection, + CommentThreadActivityMessage: CommentThreadActivityMessage, + Commit: Commit, + CommitCollection: CommitCollection, + CountOnlyCollection: CountOnlyCollection, + DiscoverableWorkspace: DiscoverableWorkspace, + FileUpload: FileUpload, + GendoAIRender: GendoAiRender, + GendoAIRenderCollection: GendoAiRenderCollection, + LegacyCommentViewerData: LegacyCommentViewerData, + LimitedUser: LimitedUser, + Model: Model, + ModelCollection: ModelCollection, + ModelMutations: ModelMutations, + ModelsTreeItem: ModelsTreeItem, + ModelsTreeItemCollection: ModelsTreeItemCollection, + Mutation: Mutation, + Object: Object, + ObjectCollection: ObjectCollection, + PasswordStrengthCheckFeedback: PasswordStrengthCheckFeedback, + PasswordStrengthCheckResults: PasswordStrengthCheckResults, + PendingStreamCollaborator: PendingStreamCollaborator, + PendingWorkspaceCollaborator: PendingWorkspaceCollaborator, + Project: Project, + ProjectAccessRequest: ProjectAccessRequest, + ProjectAccessRequestMutations: ProjectAccessRequestMutations, + ProjectAutomationMutations: ProjectAutomationMutations, + ProjectAutomationsUpdatedMessage: ProjectAutomationsUpdatedMessage, + ProjectCollaborator: ProjectCollaborator, + ProjectCollection: ProjectCollection, + ProjectCommentCollection: ProjectCommentCollection, + ProjectCommentsUpdatedMessage: ProjectCommentsUpdatedMessage, + ProjectFileImportUpdatedMessage: ProjectFileImportUpdatedMessage, + ProjectInviteMutations: ProjectInviteMutations, + ProjectModelsUpdatedMessage: ProjectModelsUpdatedMessage, + ProjectMutations: ProjectMutations, + ProjectPendingModelsUpdatedMessage: ProjectPendingModelsUpdatedMessage, + ProjectPendingVersionsUpdatedMessage: ProjectPendingVersionsUpdatedMessage, + ProjectTriggeredAutomationsStatusUpdatedMessage: ProjectTriggeredAutomationsStatusUpdatedMessage, + ProjectUpdatedMessage: ProjectUpdatedMessage, + ProjectVersionsPreviewGeneratedMessage: ProjectVersionsPreviewGeneratedMessage, + ProjectVersionsUpdatedMessage: ProjectVersionsUpdatedMessage, + Query: Query, + ResourceIdentifier: ResourceIdentifier, + Role: Role, + Scope: Scope, + ServerApp: ServerApp, + ServerAppListItem: ServerAppListItem, + ServerAutomateInfo: ServerAutomateInfo, + ServerConfiguration: ServerConfiguration, + ServerInfo: ServerInfo, + ServerInvite: ServerInvite, + ServerMigration: ServerMigration, + ServerRoleItem: ServerRoleItem, + ServerStatistics: ServerStatistics, + ServerStats: ServerStats, + ServerWorkspacesInfo: ServerWorkspacesInfo, + SmartTextEditorValue: SmartTextEditorValue, + Stream: Stream, + StreamAccessRequest: StreamAccessRequest, + StreamCollaborator: StreamCollaborator, + StreamCollection: StreamCollection, + Subscription: Subscription, + TestAutomationRun: TestAutomationRun, + TestAutomationRunTrigger: TestAutomationRunTrigger, + TestAutomationRunTriggerPayload: TestAutomationRunTriggerPayload, + TokenResourceIdentifier: TokenResourceIdentifier, + TriggeredAutomationsStatus: TriggeredAutomationsStatus, + User: User, + UserAutomateInfo: UserAutomateInfo, + UserEmail: UserEmail, + UserEmailMutations: UserEmailMutations, + UserProjectsUpdatedMessage: UserProjectsUpdatedMessage, + UserSearchResultCollection: UserSearchResultCollection, + Version: Version, + VersionCollection: VersionCollection, + VersionCreatedTrigger: VersionCreatedTrigger, + VersionCreatedTriggerDefinition: VersionCreatedTriggerDefinition, + VersionMutations: VersionMutations, + ViewerResourceGroup: ViewerResourceGroup, + ViewerResourceItem: ViewerResourceItem, + ViewerUserActivityMessage: ViewerUserActivityMessage, + Webhook: Webhook, + WebhookCollection: WebhookCollection, + WebhookEvent: WebhookEvent, + WebhookEventCollection: WebhookEventCollection, + Workspace: Workspace, + WorkspaceBilling: WorkspaceBilling, + WorkspaceCollaborator: WorkspaceCollaborator, + WorkspaceCollaboratorCollection: WorkspaceCollaboratorCollection, + WorkspaceCollection: WorkspaceCollection, + WorkspaceCost: WorkspaceCost, + WorkspaceCostDiscount: WorkspaceCostDiscount, + WorkspaceCostItem: WorkspaceCostItem, + WorkspaceDomain: WorkspaceDomain, + WorkspaceInviteMutations: WorkspaceInviteMutations, + WorkspaceMutations: WorkspaceMutations, + WorkspaceVersionsCount: WorkspaceVersionsCount, +} +export type ActiveUserMutationsFieldArgs = { + emailMutations: {}, + finishOnboarding: {}, + update: ActiveUserMutationsUpdateArgs, +} +export type ActivityFieldArgs = { + actionType: {}, + id: {}, + info: {}, + message: {}, + resourceId: {}, + resourceType: {}, + streamId: {}, + time: {}, + userId: {}, +} +export type ActivityCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type AdminInviteListFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type AdminQueriesFieldArgs = { + inviteList: AdminQueriesInviteListArgs, + projectList: AdminQueriesProjectListArgs, + serverStatistics: {}, + userList: AdminQueriesUserListArgs, + workspaceList: AdminQueriesWorkspaceListArgs, +} +export type AdminUserListFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type AdminUserListItemFieldArgs = { + avatar: {}, + company: {}, + email: {}, + id: {}, + name: {}, + role: {}, + verified: {}, +} +export type AdminUsersListCollectionFieldArgs = { + items: {}, + totalCount: {}, +} +export type AdminUsersListItemFieldArgs = { + id: {}, + invitedUser: {}, + registeredUser: {}, +} +export type ApiTokenFieldArgs = { + createdAt: {}, + id: {}, + lastChars: {}, + lastUsed: {}, + lifespan: {}, + name: {}, + scopes: {}, +} +export type AppAuthorFieldArgs = { + avatar: {}, + id: {}, + name: {}, +} +export type AuthStrategyFieldArgs = { + color: {}, + icon: {}, + id: {}, + name: {}, + url: {}, +} +export type AutomateFunctionFieldArgs = { + automationCount: {}, + creator: {}, + description: {}, + id: {}, + isFeatured: {}, + logo: {}, + name: {}, + releases: AutomateFunctionReleasesArgs, + repo: {}, + supportedSourceApps: {}, + tags: {}, +} +export type AutomateFunctionCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type AutomateFunctionReleaseFieldArgs = { + commitId: {}, + createdAt: {}, + function: {}, + functionId: {}, + id: {}, + inputSchema: {}, + versionTag: {}, +} +export type AutomateFunctionReleaseCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type AutomateFunctionRunFieldArgs = { + contextView: {}, + createdAt: {}, + elapsed: {}, + function: {}, + functionId: {}, + functionReleaseId: {}, + id: {}, + results: {}, + status: {}, + statusMessage: {}, + updatedAt: {}, +} +export type AutomateFunctionTemplateFieldArgs = { + id: {}, + logo: {}, + title: {}, + url: {}, +} +export type AutomateMutationsFieldArgs = { + createFunction: AutomateMutationsCreateFunctionArgs, + updateFunction: AutomateMutationsUpdateFunctionArgs, +} +export type AutomateRunFieldArgs = { + automation: {}, + automationId: {}, + createdAt: {}, + functionRuns: {}, + id: {}, + status: {}, + trigger: {}, + updatedAt: {}, +} +export type AutomateRunCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type AutomationFieldArgs = { + createdAt: {}, + creationPublicKeys: {}, + currentRevision: {}, + enabled: {}, + id: {}, + isTestAutomation: {}, + name: {}, + runs: AutomationRunsArgs, + updatedAt: {}, +} +export type AutomationCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type AutomationRevisionFieldArgs = { + functions: {}, + id: {}, + triggerDefinitions: {}, +} +export type AutomationRevisionFunctionFieldArgs = { + parameters: {}, + release: {}, +} +export type AvatarUserFieldArgs = { + avatar: {}, + id: {}, + name: {}, +} +export type BasicGitRepositoryMetadataFieldArgs = { + id: {}, + name: {}, + owner: {}, + url: {}, +} +export type BlobMetadataFieldArgs = { + createdAt: {}, + fileHash: {}, + fileName: {}, + fileSize: {}, + fileType: {}, + id: {}, + streamId: {}, + uploadError: {}, + uploadStatus: {}, + userId: {}, +} +export type BlobMetadataCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, + totalSize: {}, +} +export type BranchFieldArgs = { + activity: BranchActivityArgs, + author: {}, + commits: BranchCommitsArgs, + createdAt: {}, + description: {}, + id: {}, + name: {}, +} +export type BranchCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type CommentFieldArgs = { + archived: {}, + author: {}, + authorId: {}, + createdAt: {}, + data: {}, + hasParent: {}, + id: {}, + parent: {}, + rawText: {}, + reactions: {}, + replies: CommentRepliesArgs, + replyAuthors: CommentReplyAuthorsArgs, + resources: {}, + screenshot: {}, + text: {}, + updatedAt: {}, + viewedAt: {}, + viewerResources: {}, + viewerState: {}, +} +export type CommentActivityMessageFieldArgs = { + comment: {}, + type: {}, +} +export type CommentCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type CommentDataFiltersFieldArgs = { + hiddenIds: {}, + isolatedIds: {}, + passMax: {}, + passMin: {}, + propertyInfoKey: {}, + sectionBox: {}, +} +export type CommentMutationsFieldArgs = { + archive: CommentMutationsArchiveArgs, + create: CommentMutationsCreateArgs, + edit: CommentMutationsEditArgs, + markViewed: CommentMutationsMarkViewedArgs, + reply: CommentMutationsReplyArgs, +} +export type CommentReplyAuthorCollectionFieldArgs = { + items: {}, + totalCount: {}, +} +export type CommentThreadActivityMessageFieldArgs = { + data: {}, + reply: {}, + type: {}, +} +export type CommitFieldArgs = { + activity: CommitActivityArgs, + authorAvatar: {}, + authorId: {}, + authorName: {}, + branch: {}, + branchName: {}, + commentCount: {}, + createdAt: {}, + id: {}, + message: {}, + parents: {}, + referencedObject: {}, + sourceApplication: {}, + stream: {}, + streamId: {}, + streamName: {}, + totalChildrenCount: {}, +} +export type CommitCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type CountOnlyCollectionFieldArgs = { + totalCount: {}, +} +export type DiscoverableWorkspaceFieldArgs = { + defaultLogoIndex: {}, + description: {}, + id: {}, + logo: {}, + name: {}, +} +export type FileUploadFieldArgs = { + branchName: {}, + convertedCommitId: {}, + convertedLastUpdate: {}, + convertedMessage: {}, + convertedStatus: {}, + convertedVersionId: {}, + fileName: {}, + fileSize: {}, + fileType: {}, + id: {}, + model: {}, + modelName: {}, + projectId: {}, + streamId: {}, + uploadComplete: {}, + uploadDate: {}, + userId: {}, +} +export type GendoAiRenderFieldArgs = { + camera: {}, + createdAt: {}, + gendoGenerationId: {}, + id: {}, + modelId: {}, + projectId: {}, + prompt: {}, + responseImage: {}, + status: {}, + updatedAt: {}, + user: {}, + userId: {}, + versionId: {}, +} +export type GendoAiRenderCollectionFieldArgs = { + items: {}, + totalCount: {}, +} +export type LegacyCommentViewerDataFieldArgs = { + camPos: {}, + filters: {}, + location: {}, + sectionBox: {}, + selection: {}, +} +export type LimitedUserFieldArgs = { + activity: LimitedUserActivityArgs, + avatar: {}, + bio: {}, + commits: LimitedUserCommitsArgs, + company: {}, + id: {}, + name: {}, + role: {}, + streams: LimitedUserStreamsArgs, + timeline: LimitedUserTimelineArgs, + totalOwnedStreamsFavorites: {}, + verified: {}, + workspaceDomainPolicyCompliant: LimitedUserWorkspaceDomainPolicyCompliantArgs, +} +export type ModelFieldArgs = { + author: {}, + automationsStatus: {}, + childrenTree: {}, + commentThreads: ModelCommentThreadsArgs, + createdAt: {}, + description: {}, + displayName: {}, + id: {}, + name: {}, + pendingImportedVersions: ModelPendingImportedVersionsArgs, + previewUrl: {}, + updatedAt: {}, + version: ModelVersionArgs, + versions: ModelVersionsArgs, +} +export type ModelCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type ModelMutationsFieldArgs = { + create: ModelMutationsCreateArgs, + delete: ModelMutationsDeleteArgs, + update: ModelMutationsUpdateArgs, +} +export type ModelsTreeItemFieldArgs = { + children: {}, + fullName: {}, + hasChildren: {}, + id: {}, + model: {}, + name: {}, + updatedAt: {}, +} +export type ModelsTreeItemCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type MutationFieldArgs = { + _: {}, + activeUserMutations: {}, + adminDeleteUser: MutationAdminDeleteUserArgs, + apiTokenCreate: MutationApiTokenCreateArgs, + apiTokenRevoke: MutationApiTokenRevokeArgs, + appCreate: MutationAppCreateArgs, + appDelete: MutationAppDeleteArgs, + appRevokeAccess: MutationAppRevokeAccessArgs, + appTokenCreate: MutationAppTokenCreateArgs, + appUpdate: MutationAppUpdateArgs, + automateFunctionRunStatusReport: MutationAutomateFunctionRunStatusReportArgs, + automateMutations: {}, + branchCreate: MutationBranchCreateArgs, + branchDelete: MutationBranchDeleteArgs, + branchUpdate: MutationBranchUpdateArgs, + broadcastViewerUserActivity: MutationBroadcastViewerUserActivityArgs, + commentArchive: MutationCommentArchiveArgs, + commentCreate: MutationCommentCreateArgs, + commentEdit: MutationCommentEditArgs, + commentMutations: {}, + commentReply: MutationCommentReplyArgs, + commentView: MutationCommentViewArgs, + commitCreate: MutationCommitCreateArgs, + commitDelete: MutationCommitDeleteArgs, + commitReceive: MutationCommitReceiveArgs, + commitUpdate: MutationCommitUpdateArgs, + commitsDelete: MutationCommitsDeleteArgs, + commitsMove: MutationCommitsMoveArgs, + inviteDelete: MutationInviteDeleteArgs, + inviteResend: MutationInviteResendArgs, + modelMutations: {}, + objectCreate: MutationObjectCreateArgs, + projectMutations: {}, + requestVerification: {}, + requestVerificationByEmail: MutationRequestVerificationByEmailArgs, + serverInfoUpdate: MutationServerInfoUpdateArgs, + serverInviteBatchCreate: MutationServerInviteBatchCreateArgs, + serverInviteCreate: MutationServerInviteCreateArgs, + streamAccessRequestCreate: MutationStreamAccessRequestCreateArgs, + streamAccessRequestUse: MutationStreamAccessRequestUseArgs, + streamCreate: MutationStreamCreateArgs, + streamDelete: MutationStreamDeleteArgs, + streamFavorite: MutationStreamFavoriteArgs, + streamInviteBatchCreate: MutationStreamInviteBatchCreateArgs, + streamInviteCancel: MutationStreamInviteCancelArgs, + streamInviteCreate: MutationStreamInviteCreateArgs, + streamInviteUse: MutationStreamInviteUseArgs, + streamLeave: MutationStreamLeaveArgs, + streamRevokePermission: MutationStreamRevokePermissionArgs, + streamUpdate: MutationStreamUpdateArgs, + streamUpdatePermission: MutationStreamUpdatePermissionArgs, + streamsDelete: MutationStreamsDeleteArgs, + userCommentThreadActivityBroadcast: MutationUserCommentThreadActivityBroadcastArgs, + userDelete: MutationUserDeleteArgs, + userNotificationPreferencesUpdate: MutationUserNotificationPreferencesUpdateArgs, + userRoleChange: MutationUserRoleChangeArgs, + userUpdate: MutationUserUpdateArgs, + userViewerActivityBroadcast: MutationUserViewerActivityBroadcastArgs, + versionMutations: {}, + webhookCreate: MutationWebhookCreateArgs, + webhookDelete: MutationWebhookDeleteArgs, + webhookUpdate: MutationWebhookUpdateArgs, + workspaceMutations: {}, +} +export type ObjectFieldArgs = { + applicationId: {}, + children: ObjectChildrenArgs, + commentCount: {}, + createdAt: {}, + data: {}, + id: {}, + speckleType: {}, + totalChildrenCount: {}, +} +export type ObjectCollectionFieldArgs = { + cursor: {}, + objects: {}, + totalCount: {}, +} +export type PasswordStrengthCheckFeedbackFieldArgs = { + suggestions: {}, + warning: {}, +} +export type PasswordStrengthCheckResultsFieldArgs = { + feedback: {}, + score: {}, +} +export type PendingStreamCollaboratorFieldArgs = { + id: {}, + inviteId: {}, + invitedBy: {}, + projectId: {}, + projectName: {}, + role: {}, + streamId: {}, + streamName: {}, + title: {}, + token: {}, + user: {}, +} +export type PendingWorkspaceCollaboratorFieldArgs = { + email: {}, + id: {}, + inviteId: {}, + invitedBy: {}, + role: {}, + title: {}, + token: {}, + updatedAt: {}, + user: {}, + workspaceId: {}, + workspaceName: {}, +} +export type ProjectFieldArgs = { + allowPublicComments: {}, + automation: ProjectAutomationArgs, + automations: ProjectAutomationsArgs, + blob: ProjectBlobArgs, + blobs: ProjectBlobsArgs, + comment: ProjectCommentArgs, + commentThreads: ProjectCommentThreadsArgs, + createdAt: {}, + description: {}, + id: {}, + invitedTeam: {}, + model: ProjectModelArgs, + modelByName: ProjectModelByNameArgs, + modelChildrenTree: ProjectModelChildrenTreeArgs, + models: ProjectModelsArgs, + modelsTree: ProjectModelsTreeArgs, + name: {}, + object: ProjectObjectArgs, + pendingAccessRequests: {}, + pendingImportedModels: ProjectPendingImportedModelsArgs, + role: {}, + sourceApps: {}, + team: {}, + updatedAt: {}, + version: ProjectVersionArgs, + versions: ProjectVersionsArgs, + viewerResources: ProjectViewerResourcesArgs, + visibility: {}, + webhooks: ProjectWebhooksArgs, + workspace: {}, + workspaceId: {}, +} +export type ProjectAccessRequestFieldArgs = { + createdAt: {}, + id: {}, + project: {}, + projectId: {}, + requester: {}, + requesterId: {}, +} +export type ProjectAccessRequestMutationsFieldArgs = { + create: ProjectAccessRequestMutationsCreateArgs, + use: ProjectAccessRequestMutationsUseArgs, +} +export type ProjectAutomationMutationsFieldArgs = { + create: ProjectAutomationMutationsCreateArgs, + createRevision: ProjectAutomationMutationsCreateRevisionArgs, + createTestAutomation: ProjectAutomationMutationsCreateTestAutomationArgs, + createTestAutomationRun: ProjectAutomationMutationsCreateTestAutomationRunArgs, + trigger: ProjectAutomationMutationsTriggerArgs, + update: ProjectAutomationMutationsUpdateArgs, +} +export type ProjectAutomationsUpdatedMessageFieldArgs = { + automation: {}, + automationId: {}, + revision: {}, + type: {}, +} +export type ProjectCollaboratorFieldArgs = { + id: {}, + role: {}, + user: {}, +} +export type ProjectCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type ProjectCommentCollectionFieldArgs = { + cursor: {}, + items: {}, + totalArchivedCount: {}, + totalCount: {}, +} +export type ProjectCommentsUpdatedMessageFieldArgs = { + comment: {}, + id: {}, + type: {}, +} +export type ProjectFileImportUpdatedMessageFieldArgs = { + id: {}, + type: {}, + upload: {}, +} +export type ProjectInviteMutationsFieldArgs = { + batchCreate: ProjectInviteMutationsBatchCreateArgs, + cancel: ProjectInviteMutationsCancelArgs, + create: ProjectInviteMutationsCreateArgs, + createForWorkspace: ProjectInviteMutationsCreateForWorkspaceArgs, + use: ProjectInviteMutationsUseArgs, +} +export type ProjectModelsUpdatedMessageFieldArgs = { + id: {}, + model: {}, + type: {}, +} +export type ProjectMutationsFieldArgs = { + accessRequestMutations: {}, + automationMutations: ProjectMutationsAutomationMutationsArgs, + batchDelete: ProjectMutationsBatchDeleteArgs, + create: ProjectMutationsCreateArgs, + createForOnboarding: {}, + delete: ProjectMutationsDeleteArgs, + invites: {}, + leave: ProjectMutationsLeaveArgs, + update: ProjectMutationsUpdateArgs, + updateRole: ProjectMutationsUpdateRoleArgs, +} +export type ProjectPendingModelsUpdatedMessageFieldArgs = { + id: {}, + model: {}, + type: {}, +} +export type ProjectPendingVersionsUpdatedMessageFieldArgs = { + id: {}, + type: {}, + version: {}, +} +export type ProjectTriggeredAutomationsStatusUpdatedMessageFieldArgs = { + model: {}, + project: {}, + run: {}, + type: {}, + version: {}, +} +export type ProjectUpdatedMessageFieldArgs = { + id: {}, + project: {}, + type: {}, +} +export type ProjectVersionsPreviewGeneratedMessageFieldArgs = { + objectId: {}, + projectId: {}, + versionId: {}, +} +export type ProjectVersionsUpdatedMessageFieldArgs = { + id: {}, + modelId: {}, + type: {}, + version: {}, +} +export type QueryFieldArgs = { + _: {}, + activeUser: {}, + admin: {}, + adminStreams: QueryAdminStreamsArgs, + adminUsers: QueryAdminUsersArgs, + app: QueryAppArgs, + apps: {}, + authenticatedAsApp: {}, + automateFunction: QueryAutomateFunctionArgs, + automateFunctions: QueryAutomateFunctionsArgs, + automateValidateAuthCode: QueryAutomateValidateAuthCodeArgs, + comment: QueryCommentArgs, + comments: QueryCommentsArgs, + discoverableStreams: QueryDiscoverableStreamsArgs, + otherUser: QueryOtherUserArgs, + project: QueryProjectArgs, + projectInvite: QueryProjectInviteArgs, + serverInfo: {}, + serverInviteByToken: QueryServerInviteByTokenArgs, + serverStats: {}, + stream: QueryStreamArgs, + streamAccessRequest: QueryStreamAccessRequestArgs, + streamInvite: QueryStreamInviteArgs, + streamInvites: {}, + streams: QueryStreamsArgs, + user: QueryUserArgs, + userPwdStrength: QueryUserPwdStrengthArgs, + userSearch: QueryUserSearchArgs, + workspace: QueryWorkspaceArgs, + workspaceInvite: QueryWorkspaceInviteArgs, +} +export type ResourceIdentifierFieldArgs = { + resourceId: {}, + resourceType: {}, +} +export type RoleFieldArgs = { + description: {}, + name: {}, + resourceTarget: {}, +} +export type ScopeFieldArgs = { + description: {}, + name: {}, +} +export type ServerAppFieldArgs = { + author: {}, + createdAt: {}, + description: {}, + id: {}, + logo: {}, + name: {}, + public: {}, + redirectUrl: {}, + scopes: {}, + secret: {}, + termsAndConditionsLink: {}, + trustByDefault: {}, +} +export type ServerAppListItemFieldArgs = { + author: {}, + description: {}, + id: {}, + logo: {}, + name: {}, + redirectUrl: {}, + termsAndConditionsLink: {}, + trustByDefault: {}, +} +export type ServerAutomateInfoFieldArgs = { + availableFunctionTemplates: {}, +} +export type ServerConfigurationFieldArgs = { + blobSizeLimitBytes: {}, + objectMultipartUploadSizeLimitBytes: {}, + objectSizeLimitBytes: {}, +} +export type ServerInfoFieldArgs = { + adminContact: {}, + authStrategies: {}, + automate: {}, + automateUrl: {}, + blobSizeLimitBytes: {}, + canonicalUrl: {}, + company: {}, + configuration: {}, + description: {}, + enableNewWebUiMessaging: {}, + guestModeEnabled: {}, + inviteOnly: {}, + migration: {}, + name: {}, + roles: {}, + scopes: {}, + serverRoles: {}, + termsOfService: {}, + version: {}, + workspaces: {}, +} +export type ServerInviteFieldArgs = { + email: {}, + id: {}, + invitedBy: {}, +} +export type ServerMigrationFieldArgs = { + movedFrom: {}, + movedTo: {}, +} +export type ServerRoleItemFieldArgs = { + id: {}, + title: {}, +} +export type ServerStatisticsFieldArgs = { + totalPendingInvites: {}, + totalProjectCount: {}, + totalUserCount: {}, +} +export type ServerStatsFieldArgs = { + commitHistory: {}, + objectHistory: {}, + streamHistory: {}, + totalCommitCount: {}, + totalObjectCount: {}, + totalStreamCount: {}, + totalUserCount: {}, + userHistory: {}, +} +export type ServerWorkspacesInfoFieldArgs = { + workspacesEnabled: {}, +} +export type SmartTextEditorValueFieldArgs = { + attachments: {}, + doc: {}, + type: {}, + version: {}, +} +export type StreamFieldArgs = { + activity: StreamActivityArgs, + allowPublicComments: {}, + blob: StreamBlobArgs, + blobs: StreamBlobsArgs, + branch: StreamBranchArgs, + branches: StreamBranchesArgs, + collaborators: {}, + commentCount: {}, + commit: StreamCommitArgs, + commits: StreamCommitsArgs, + createdAt: {}, + description: {}, + favoritedDate: {}, + favoritesCount: {}, + fileUpload: StreamFileUploadArgs, + fileUploads: {}, + id: {}, + isDiscoverable: {}, + isPublic: {}, + name: {}, + object: StreamObjectArgs, + pendingAccessRequests: {}, + pendingCollaborators: {}, + role: {}, + size: {}, + updatedAt: {}, + webhooks: StreamWebhooksArgs, +} +export type StreamAccessRequestFieldArgs = { + createdAt: {}, + id: {}, + requester: {}, + requesterId: {}, + stream: {}, + streamId: {}, +} +export type StreamCollaboratorFieldArgs = { + avatar: {}, + company: {}, + id: {}, + name: {}, + role: {}, + serverRole: {}, +} +export type StreamCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type SubscriptionFieldArgs = { + _: {}, + branchCreated: SubscriptionBranchCreatedArgs, + branchDeleted: SubscriptionBranchDeletedArgs, + branchUpdated: SubscriptionBranchUpdatedArgs, + commentActivity: SubscriptionCommentActivityArgs, + commentThreadActivity: SubscriptionCommentThreadActivityArgs, + commitCreated: SubscriptionCommitCreatedArgs, + commitDeleted: SubscriptionCommitDeletedArgs, + commitUpdated: SubscriptionCommitUpdatedArgs, + projectAutomationsUpdated: SubscriptionProjectAutomationsUpdatedArgs, + projectCommentsUpdated: SubscriptionProjectCommentsUpdatedArgs, + projectFileImportUpdated: SubscriptionProjectFileImportUpdatedArgs, + projectModelsUpdated: SubscriptionProjectModelsUpdatedArgs, + projectPendingModelsUpdated: SubscriptionProjectPendingModelsUpdatedArgs, + projectPendingVersionsUpdated: SubscriptionProjectPendingVersionsUpdatedArgs, + projectTriggeredAutomationsStatusUpdated: SubscriptionProjectTriggeredAutomationsStatusUpdatedArgs, + projectUpdated: SubscriptionProjectUpdatedArgs, + projectVersionGendoAIRenderCreated: SubscriptionProjectVersionGendoAiRenderCreatedArgs, + projectVersionGendoAIRenderUpdated: SubscriptionProjectVersionGendoAiRenderUpdatedArgs, + projectVersionsPreviewGenerated: SubscriptionProjectVersionsPreviewGeneratedArgs, + projectVersionsUpdated: SubscriptionProjectVersionsUpdatedArgs, + streamDeleted: SubscriptionStreamDeletedArgs, + streamUpdated: SubscriptionStreamUpdatedArgs, + userProjectsUpdated: {}, + userStreamAdded: {}, + userStreamRemoved: {}, + userViewerActivity: SubscriptionUserViewerActivityArgs, + viewerUserActivityBroadcasted: SubscriptionViewerUserActivityBroadcastedArgs, +} +export type TestAutomationRunFieldArgs = { + automationRunId: {}, + functionRunId: {}, + triggers: {}, +} +export type TestAutomationRunTriggerFieldArgs = { + payload: {}, + triggerType: {}, +} +export type TestAutomationRunTriggerPayloadFieldArgs = { + modelId: {}, + versionId: {}, +} +export type TokenResourceIdentifierFieldArgs = { + id: {}, + type: {}, +} +export type TriggeredAutomationsStatusFieldArgs = { + automationRuns: {}, + id: {}, + status: {}, + statusMessage: {}, +} +export type UserFieldArgs = { + activity: UserActivityArgs, + apiTokens: {}, + authorizedApps: {}, + automateInfo: {}, + avatar: {}, + bio: {}, + commits: UserCommitsArgs, + company: {}, + createdApps: {}, + createdAt: {}, + discoverableWorkspaces: {}, + email: {}, + emails: {}, + favoriteStreams: UserFavoriteStreamsArgs, + hasPendingVerification: {}, + id: {}, + isOnboardingFinished: {}, + name: {}, + notificationPreferences: {}, + profiles: {}, + projectAccessRequest: UserProjectAccessRequestArgs, + projectInvites: {}, + projects: UserProjectsArgs, + role: {}, + streams: UserStreamsArgs, + timeline: UserTimelineArgs, + totalOwnedStreamsFavorites: {}, + verified: {}, + versions: UserVersionsArgs, + workspaceInvites: {}, + workspaces: UserWorkspacesArgs, +} +export type UserAutomateInfoFieldArgs = { + availableGithubOrgs: {}, + hasAutomateGithubApp: {}, +} +export type UserEmailFieldArgs = { + email: {}, + id: {}, + primary: {}, + userId: {}, + verified: {}, +} +export type UserEmailMutationsFieldArgs = { + create: UserEmailMutationsCreateArgs, + delete: UserEmailMutationsDeleteArgs, + requestNewEmailVerification: UserEmailMutationsRequestNewEmailVerificationArgs, + setPrimary: UserEmailMutationsSetPrimaryArgs, +} +export type UserProjectsUpdatedMessageFieldArgs = { + id: {}, + project: {}, + type: {}, +} +export type UserSearchResultCollectionFieldArgs = { + cursor: {}, + items: {}, +} +export type VersionFieldArgs = { + authorUser: {}, + automationsStatus: {}, + commentThreads: VersionCommentThreadsArgs, + createdAt: {}, + gendoAIRender: VersionGendoAiRenderArgs, + gendoAIRenders: {}, + id: {}, + message: {}, + model: {}, + parents: {}, + previewUrl: {}, + referencedObject: {}, + sourceApplication: {}, + totalChildrenCount: {}, +} +export type VersionCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type VersionCreatedTriggerFieldArgs = { + model: {}, + type: {}, + version: {}, +} +export type VersionCreatedTriggerDefinitionFieldArgs = { + model: {}, + type: {}, +} +export type VersionMutationsFieldArgs = { + create: VersionMutationsCreateArgs, + delete: VersionMutationsDeleteArgs, + markReceived: VersionMutationsMarkReceivedArgs, + moveToModel: VersionMutationsMoveToModelArgs, + requestGendoAIRender: VersionMutationsRequestGendoAiRenderArgs, + update: VersionMutationsUpdateArgs, +} +export type ViewerResourceGroupFieldArgs = { + identifier: {}, + items: {}, +} +export type ViewerResourceItemFieldArgs = { + modelId: {}, + objectId: {}, + versionId: {}, +} +export type ViewerUserActivityMessageFieldArgs = { + sessionId: {}, + state: {}, + status: {}, + user: {}, + userId: {}, + userName: {}, +} +export type WebhookFieldArgs = { + description: {}, + enabled: {}, + hasSecret: {}, + history: WebhookHistoryArgs, + id: {}, + projectId: {}, + streamId: {}, + triggers: {}, + url: {}, +} +export type WebhookCollectionFieldArgs = { + items: {}, + totalCount: {}, +} +export type WebhookEventFieldArgs = { + id: {}, + lastUpdate: {}, + payload: {}, + retryCount: {}, + status: {}, + statusInfo: {}, + webhookId: {}, +} +export type WebhookEventCollectionFieldArgs = { + items: {}, + totalCount: {}, +} +export type WorkspaceFieldArgs = { + billing: {}, + createdAt: {}, + defaultLogoIndex: {}, + description: {}, + discoverabilityEnabled: {}, + domainBasedMembershipProtectionEnabled: {}, + domains: {}, + id: {}, + invitedTeam: WorkspaceInvitedTeamArgs, + logo: {}, + name: {}, + projects: WorkspaceProjectsArgs, + role: {}, + team: WorkspaceTeamArgs, + updatedAt: {}, +} +export type WorkspaceBillingFieldArgs = { + cost: {}, + versionsCount: {}, +} +export type WorkspaceCollaboratorFieldArgs = { + id: {}, + role: {}, + user: {}, +} +export type WorkspaceCollaboratorCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type WorkspaceCollectionFieldArgs = { + cursor: {}, + items: {}, + totalCount: {}, +} +export type WorkspaceCostFieldArgs = { + currency: {}, + discount: {}, + items: {}, + subTotal: {}, + total: {}, +} +export type WorkspaceCostDiscountFieldArgs = { + amount: {}, + name: {}, +} +export type WorkspaceCostItemFieldArgs = { + cost: {}, + count: {}, + name: {}, +} +export type WorkspaceDomainFieldArgs = { + domain: {}, + id: {}, +} +export type WorkspaceInviteMutationsFieldArgs = { + batchCreate: WorkspaceInviteMutationsBatchCreateArgs, + cancel: WorkspaceInviteMutationsCancelArgs, + create: WorkspaceInviteMutationsCreateArgs, + resend: WorkspaceInviteMutationsResendArgs, + use: WorkspaceInviteMutationsUseArgs, +} +export type WorkspaceMutationsFieldArgs = { + addDomain: WorkspaceMutationsAddDomainArgs, + create: WorkspaceMutationsCreateArgs, + delete: WorkspaceMutationsDeleteArgs, + deleteDomain: WorkspaceMutationsDeleteDomainArgs, + invites: {}, + join: WorkspaceMutationsJoinArgs, + leave: WorkspaceMutationsLeaveArgs, + update: WorkspaceMutationsUpdateArgs, + updateRole: WorkspaceMutationsUpdateRoleArgs, +} +export type WorkspaceVersionsCountFieldArgs = { + current: {}, + max: {}, +} +export type AllObjectFieldArgTypes = { + ActiveUserMutations: ActiveUserMutationsFieldArgs, + Activity: ActivityFieldArgs, + ActivityCollection: ActivityCollectionFieldArgs, + AdminInviteList: AdminInviteListFieldArgs, + AdminQueries: AdminQueriesFieldArgs, + AdminUserList: AdminUserListFieldArgs, + AdminUserListItem: AdminUserListItemFieldArgs, + AdminUsersListCollection: AdminUsersListCollectionFieldArgs, + AdminUsersListItem: AdminUsersListItemFieldArgs, + ApiToken: ApiTokenFieldArgs, + AppAuthor: AppAuthorFieldArgs, + AuthStrategy: AuthStrategyFieldArgs, + AutomateFunction: AutomateFunctionFieldArgs, + AutomateFunctionCollection: AutomateFunctionCollectionFieldArgs, + AutomateFunctionRelease: AutomateFunctionReleaseFieldArgs, + AutomateFunctionReleaseCollection: AutomateFunctionReleaseCollectionFieldArgs, + AutomateFunctionRun: AutomateFunctionRunFieldArgs, + AutomateFunctionTemplate: AutomateFunctionTemplateFieldArgs, + AutomateMutations: AutomateMutationsFieldArgs, + AutomateRun: AutomateRunFieldArgs, + AutomateRunCollection: AutomateRunCollectionFieldArgs, + Automation: AutomationFieldArgs, + AutomationCollection: AutomationCollectionFieldArgs, + AutomationRevision: AutomationRevisionFieldArgs, + AutomationRevisionFunction: AutomationRevisionFunctionFieldArgs, + AvatarUser: AvatarUserFieldArgs, + BasicGitRepositoryMetadata: BasicGitRepositoryMetadataFieldArgs, + BlobMetadata: BlobMetadataFieldArgs, + BlobMetadataCollection: BlobMetadataCollectionFieldArgs, + Branch: BranchFieldArgs, + BranchCollection: BranchCollectionFieldArgs, + Comment: CommentFieldArgs, + CommentActivityMessage: CommentActivityMessageFieldArgs, + CommentCollection: CommentCollectionFieldArgs, + CommentDataFilters: CommentDataFiltersFieldArgs, + CommentMutations: CommentMutationsFieldArgs, + CommentReplyAuthorCollection: CommentReplyAuthorCollectionFieldArgs, + CommentThreadActivityMessage: CommentThreadActivityMessageFieldArgs, + Commit: CommitFieldArgs, + CommitCollection: CommitCollectionFieldArgs, + CountOnlyCollection: CountOnlyCollectionFieldArgs, + DiscoverableWorkspace: DiscoverableWorkspaceFieldArgs, + FileUpload: FileUploadFieldArgs, + GendoAIRender: GendoAiRenderFieldArgs, + GendoAIRenderCollection: GendoAiRenderCollectionFieldArgs, + LegacyCommentViewerData: LegacyCommentViewerDataFieldArgs, + LimitedUser: LimitedUserFieldArgs, + Model: ModelFieldArgs, + ModelCollection: ModelCollectionFieldArgs, + ModelMutations: ModelMutationsFieldArgs, + ModelsTreeItem: ModelsTreeItemFieldArgs, + ModelsTreeItemCollection: ModelsTreeItemCollectionFieldArgs, + Mutation: MutationFieldArgs, + Object: ObjectFieldArgs, + ObjectCollection: ObjectCollectionFieldArgs, + PasswordStrengthCheckFeedback: PasswordStrengthCheckFeedbackFieldArgs, + PasswordStrengthCheckResults: PasswordStrengthCheckResultsFieldArgs, + PendingStreamCollaborator: PendingStreamCollaboratorFieldArgs, + PendingWorkspaceCollaborator: PendingWorkspaceCollaboratorFieldArgs, + Project: ProjectFieldArgs, + ProjectAccessRequest: ProjectAccessRequestFieldArgs, + ProjectAccessRequestMutations: ProjectAccessRequestMutationsFieldArgs, + ProjectAutomationMutations: ProjectAutomationMutationsFieldArgs, + ProjectAutomationsUpdatedMessage: ProjectAutomationsUpdatedMessageFieldArgs, + ProjectCollaborator: ProjectCollaboratorFieldArgs, + ProjectCollection: ProjectCollectionFieldArgs, + ProjectCommentCollection: ProjectCommentCollectionFieldArgs, + ProjectCommentsUpdatedMessage: ProjectCommentsUpdatedMessageFieldArgs, + ProjectFileImportUpdatedMessage: ProjectFileImportUpdatedMessageFieldArgs, + ProjectInviteMutations: ProjectInviteMutationsFieldArgs, + ProjectModelsUpdatedMessage: ProjectModelsUpdatedMessageFieldArgs, + ProjectMutations: ProjectMutationsFieldArgs, + ProjectPendingModelsUpdatedMessage: ProjectPendingModelsUpdatedMessageFieldArgs, + ProjectPendingVersionsUpdatedMessage: ProjectPendingVersionsUpdatedMessageFieldArgs, + ProjectTriggeredAutomationsStatusUpdatedMessage: ProjectTriggeredAutomationsStatusUpdatedMessageFieldArgs, + ProjectUpdatedMessage: ProjectUpdatedMessageFieldArgs, + ProjectVersionsPreviewGeneratedMessage: ProjectVersionsPreviewGeneratedMessageFieldArgs, + ProjectVersionsUpdatedMessage: ProjectVersionsUpdatedMessageFieldArgs, + Query: QueryFieldArgs, + ResourceIdentifier: ResourceIdentifierFieldArgs, + Role: RoleFieldArgs, + Scope: ScopeFieldArgs, + ServerApp: ServerAppFieldArgs, + ServerAppListItem: ServerAppListItemFieldArgs, + ServerAutomateInfo: ServerAutomateInfoFieldArgs, + ServerConfiguration: ServerConfigurationFieldArgs, + ServerInfo: ServerInfoFieldArgs, + ServerInvite: ServerInviteFieldArgs, + ServerMigration: ServerMigrationFieldArgs, + ServerRoleItem: ServerRoleItemFieldArgs, + ServerStatistics: ServerStatisticsFieldArgs, + ServerStats: ServerStatsFieldArgs, + ServerWorkspacesInfo: ServerWorkspacesInfoFieldArgs, + SmartTextEditorValue: SmartTextEditorValueFieldArgs, + Stream: StreamFieldArgs, + StreamAccessRequest: StreamAccessRequestFieldArgs, + StreamCollaborator: StreamCollaboratorFieldArgs, + StreamCollection: StreamCollectionFieldArgs, + Subscription: SubscriptionFieldArgs, + TestAutomationRun: TestAutomationRunFieldArgs, + TestAutomationRunTrigger: TestAutomationRunTriggerFieldArgs, + TestAutomationRunTriggerPayload: TestAutomationRunTriggerPayloadFieldArgs, + TokenResourceIdentifier: TokenResourceIdentifierFieldArgs, + TriggeredAutomationsStatus: TriggeredAutomationsStatusFieldArgs, + User: UserFieldArgs, + UserAutomateInfo: UserAutomateInfoFieldArgs, + UserEmail: UserEmailFieldArgs, + UserEmailMutations: UserEmailMutationsFieldArgs, + UserProjectsUpdatedMessage: UserProjectsUpdatedMessageFieldArgs, + UserSearchResultCollection: UserSearchResultCollectionFieldArgs, + Version: VersionFieldArgs, + VersionCollection: VersionCollectionFieldArgs, + VersionCreatedTrigger: VersionCreatedTriggerFieldArgs, + VersionCreatedTriggerDefinition: VersionCreatedTriggerDefinitionFieldArgs, + VersionMutations: VersionMutationsFieldArgs, + ViewerResourceGroup: ViewerResourceGroupFieldArgs, + ViewerResourceItem: ViewerResourceItemFieldArgs, + ViewerUserActivityMessage: ViewerUserActivityMessageFieldArgs, + Webhook: WebhookFieldArgs, + WebhookCollection: WebhookCollectionFieldArgs, + WebhookEvent: WebhookEventFieldArgs, + WebhookEventCollection: WebhookEventCollectionFieldArgs, + Workspace: WorkspaceFieldArgs, + WorkspaceBilling: WorkspaceBillingFieldArgs, + WorkspaceCollaborator: WorkspaceCollaboratorFieldArgs, + WorkspaceCollaboratorCollection: WorkspaceCollaboratorCollectionFieldArgs, + WorkspaceCollection: WorkspaceCollectionFieldArgs, + WorkspaceCost: WorkspaceCostFieldArgs, + WorkspaceCostDiscount: WorkspaceCostDiscountFieldArgs, + WorkspaceCostItem: WorkspaceCostItemFieldArgs, + WorkspaceDomain: WorkspaceDomainFieldArgs, + WorkspaceInviteMutations: WorkspaceInviteMutationsFieldArgs, + WorkspaceMutations: WorkspaceMutationsFieldArgs, + WorkspaceVersionsCount: WorkspaceVersionsCountFieldArgs, +} + diff --git a/packages/frontend-2/lib/common/helpers/graphql.ts b/packages/frontend-2/lib/common/helpers/graphql.ts index 871680c17..b9308288d 100644 --- a/packages/frontend-2/lib/common/helpers/graphql.ts +++ b/packages/frontend-2/lib/common/helpers/graphql.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -import { isUndefinedOrVoid } from '@speckle/shared' -import type { Optional } from '@speckle/shared' +import { isNullOrUndefined, isUndefinedOrVoid } from '@speckle/shared' +import type { MaybeNullOrUndefined, Optional } from '@speckle/shared' import { ApolloError, defaultDataIdFromObject } from '@apollo/client/core' import type { FetchResult, @@ -15,30 +15,54 @@ import { GraphQLError } from 'graphql' import type { DocumentNode } from 'graphql' import { flatten, - isUndefined, has, isFunction, isString, isArray, - intersection + intersection, + get, + set, + cloneDeep, + isObjectLike } from 'lodash-es' -import type { Modifier, Reference } from '@apollo/client/cache' -import type { PartialDeep } from 'type-fest' +import type { Modifier, ModifierDetails, Reference } from '@apollo/client/cache' +import type { Get, PartialDeep, Paths, ReadonlyDeep, Tagged } from 'type-fest' import type { GraphQLErrors, NetworkError } from '@apollo/client/errors' import { nanoid } from 'nanoid' import { StackTrace } from '~~/lib/common/helpers/debugging' import dayjs from 'dayjs' import { base64Encode } from '~/lib/common/helpers/encodeDecode' import type { ErrorResponse } from '@apollo/client/link/error' +import type { + AllObjectFieldArgTypes, + AllObjectTypes +} from '~/lib/common/generated/gql/graphql' + +/** + * Cache key of a specific cached GQL object. Tends to look like `Type:id`. + */ +export type ApolloCacheObjectKey = Tagged< + string, + Type +> export const isServerError = (err: Error): err is ServerError => has(err, 'response') && has(err, 'result') && has(err, 'statusCode') export const isServerParseError = (err: Error): err is ServerParseError => has(err, 'response') && has(err, 'bodyText') && has(err, 'statusCode') -export const ROOT_QUERY = 'ROOT_QUERY' -export const ROOT_MUTATION = 'ROOT_MUTATION' -export const ROOT_SUBSCRIPTION = 'ROOT_SUBSCRIPTION' +export const ROOT_QUERY = 'ROOT_QUERY' as ApolloCacheObjectKey<'Query'> +export const ROOT_MUTATION = 'ROOT_MUTATION' as ApolloCacheObjectKey<'Mutation'> +export const ROOT_SUBSCRIPTION = + 'ROOT_SUBSCRIPTION' as ApolloCacheObjectKey<'Subscription'> + +type ModifyFnCacheDataSingle = Data extends Record + ? Data extends { id: string; __typename?: infer TypeName } + ? CacheObjectReference + : PartialDeep<{ + [key in keyof Data]: ModifyFnCacheData + }> + : Data /** * Utility type for typing cached data in Apollo modify functions. @@ -46,33 +70,24 @@ export const ROOT_SUBSCRIPTION = 'ROOT_SUBSCRIPTION' * to CacheObjectReference objects and additionally all properties are optional as you can never know what exactly has been requested & cached * and what hasn't */ -export type ModifyFnCacheData = Data extends - | Record - | Record[] - ? Data extends { id: string } - ? CacheObjectReference - : Data extends { id: string }[] - ? CacheObjectReference[] - : PartialDeep<{ - [key in keyof Data]: Data[key] extends { id: string } - ? CacheObjectReference - : Data[key] extends { id: string }[] - ? CacheObjectReference[] - : ModifyFnCacheData - }> - : Data +export type ModifyFnCacheData = Data extends Array + ? ModifyFnCacheDataSingle[] + : ModifyFnCacheDataSingle /** * Get a cached object's identifier */ -export function getCacheId(typeName: string, id: string) { +export function getCacheId( + typeName: Type, + id: string +): ApolloCacheObjectKey { const cachedId = defaultDataIdFromObject({ __typename: typeName, id }) if (!cachedId) throw new Error('Unable to build Apollo cache ID') - return cachedId + return cachedId as ApolloCacheObjectKey } export function isInvalidAuth(error: ApolloError | NetworkError) { @@ -277,16 +292,23 @@ export function getStoreFieldName( * Inside cache.modify calls you'll get these instead of full objects when reading fields that hold * identifiable objects or object arrays */ -export type CacheObjectReference = Reference +export type CacheObjectReference = { + readonly __ref: Type extends keyof AllObjectTypes + ? ApolloCacheObjectKey + : string +} /** * Objects & object arrays in `cache.modify` calls are represented through reference objects, so * if you want to add new ones you shouldn't add the entire object, but only its reference */ -export function getObjectReference(typeName: string, id: string): CacheObjectReference { +export function getObjectReference( + typeName: Type, + id: string +): CacheObjectReference { return { __ref: getCacheId(typeName, id) - } + } as CacheObjectReference } export function isReference(obj: unknown): obj is CacheObjectReference { @@ -332,6 +354,7 @@ export const revolveFieldNameAndVariables = < * better filtering capabilities to filter filters to update (e.g. you can actually get each field's variables) * Note: This uses cache.modify underneath which means that `data` will only hold object references (CacheObjectReference) not * full objects. Read more: https://www.apollographql.com/docs/react/caching/cache-interaction/#values-vs-references + * @deprecated Use modifyObjectField instead */ export function modifyObjectFields< Variables extends Optional> = undefined, @@ -350,7 +373,8 @@ export function modifyObjectFields< ) => | Optional> | Parameters>>[1]['DELETE'] - | Parameters>>[1]['INVALIDATE'], + | Parameters>>[1]['INVALIDATE'] + | void, options?: Partial<{ fieldNameWhitelist: string[] debug: boolean @@ -391,22 +415,27 @@ export function modifyObjectFields< ) log('invoking updater', { fieldName, variables, fieldValue }) - const res = updater( - fieldName, - (variables || {}) as Variables, - fieldValue as ModifyFnCacheData, - { - ...details, - ref: getObjectReference, - revolveFieldNameAndVariables - } - ) + try { + const res = updater( + fieldName, + (variables || {}) as Variables, + fieldValue as ModifyFnCacheData, + { + ...details, + ref: getObjectReference, + revolveFieldNameAndVariables + } + ) - if (isUndefined(res)) { - return fieldValue as unknown - } else { - log('updater returned', { res }) - return res + if (isUndefinedOrVoid(res)) { + return fieldValue as unknown + } else { + log('updater returned', { res }) + return res + } + } catch (e) { + log('updater threw an error', e) + throw e } } }) @@ -416,6 +445,7 @@ export function modifyObjectFields< * Iterate over a cached object's fields and evict/delete the ones that the predicate returns true for * Note: This uses cache.modify underneath which means that `data` will only hold object references (CacheObjectReference) not * full objects. Read more: https://www.apollographql.com/docs/react/caching/cache-interaction/#values-vs-references + * @deprecated Use modifyObjectField instead, just return the evict() call from the updater */ export function evictObjectFields< V extends Optional> = undefined, @@ -498,44 +528,6 @@ export const getDateCursorFromReference = (params: { return base64Encode(iso) } -/** - * Simplified version of modifyObjectFields, just targetting a single field - * @see modifyObjectFields - */ -export const modifyObjectField = < - FieldData = unknown, - Variables extends Optional> = undefined ->( - cache: ApolloCache, - id: string, - fieldName: string, - updater: (params: { - fieldName: string - variables: Variables - value: ModifyFnCacheData - details: Parameters>>[1] & { - ref: typeof getObjectReference - revolveFieldNameAndVariables: typeof revolveFieldNameAndVariables - } - }) => - | Optional> - | Parameters>>[1]['DELETE'] - | Parameters>>[1]['INVALIDATE'], - options?: Partial<{ - debug: boolean - }> -) => { - modifyObjectFields( - cache, - id, - (field, variables, value, details) => { - if (field !== fieldName) return - return updater({ fieldName: field, variables, value, details }) - }, - options - ) -} - /** * Build skipLoggingErrors function that skips logging errors if there's only one error and it's related to a specific field */ @@ -548,3 +540,210 @@ export const skipLoggingErrorsIfOneFieldError = err.graphQLErrors.some((e) => intersection(e.path || [], fieldNames).length > 0) ) } + +type NonUndefined = T extends undefined ? never : T + +/** + * Update field at specific path in object, only if it exists. Useful for cache modification + * when fields should only be updated if they exist. + */ +export const updatePathIfExists = & string>( + val: Value, + path: Path, + updater: (val: NonUndefined>) => NonUndefined> +) => { + if (!val) return val + + if (has(val, path)) { + const pathVal = get(val, path) as NonUndefined> + const newVal = updater(pathVal) + set(val, path, newVal) + } + + return val +} + +/** + * Get value from specific path in object, only if it exists. + */ +export const getFromPathIfExists = & string>( + val: MaybeNullOrUndefined, + path: Path +): Optional> => { + if (!val) return undefined + if (!has(val, path)) return undefined + return get(val, path) as Get +} + +type ModifyObjectFieldValue< + Type extends keyof AllObjectTypes, + Field extends keyof AllObjectTypes[Type] +> = ModifyFnCacheData + +/** + * Simplified & improved version of modifyObjectFields, just targetting a single field for a cache modification + * @see modifyObjectFields + */ +export const modifyObjectField = < + Type extends keyof AllObjectTypes, + Field extends keyof AllObjectTypes[Type] +>( + cache: ApolloCache, + key: ApolloCacheObjectKey, + fieldName: Field, + updater: (params: { + fieldName: string + variables: Field extends keyof AllObjectFieldArgTypes[Type] + ? AllObjectFieldArgTypes[Type][Field] + : never + /** + * Value found in the cache. Read-only and should not be mutated directly. Use the + * createUpdatedValue() helper to build a new value with updated fields. + */ + value: ReadonlyDeep> + helpers: { + /** + * Build new value with the values at specific paths updated with the provided updater functions, + * ONLY if the paths exist in the cache. + * + * This function operates on a deeply cloned value that is safe to mutate + */ + createUpdatedValue: ( + updateHandler: (params: { + /** + * Invoke this function to update one specific path in the object + */ + update: > & string>( + path: Path, + pathUpdate: ( + val: NonUndefined, Path>> + ) => NonUndefined, Path>> + ) => MaybeNullOrUndefined> + }) => void + ) => ModifyObjectFieldValue + /** + * Get value from specific path, only if it exists in the cache value + */ + get: > & string>( + path: Path + ) => Optional, Path>> + /** + * Invoke and return this out from the modify call to evict the field from the cache + */ + evict: () => ModifierDetails['DELETE'] + /** + * Read field data from a Reference object + */ + readField: < + ReadFieldType extends keyof AllObjectTypes, + ReadFieldName extends keyof AllObjectTypes[ReadFieldType] & string + >( + ref: CacheObjectReference, + fieldName: ReadFieldName + ) => Optional + /** + * Build a reference object for a specific object in the cache + */ + ref: typeof getObjectReference + } + }) => + | Optional> + | ReadonlyDeep> + | ModifierDetails['DELETE'] + | ModifierDetails['INVALIDATE'] + | void, + options?: Partial<{ + debug: boolean + /** + * Whether to auto evict values that have variables with common filters in them (e.g. a 'filter' or + * 'search' prop). Often its better to evict filtered values, because we can't tell if the newly + * added item should be included in the filtered list or not. + */ + autoEvictFiltered: boolean + }> +) => { + const { autoEvictFiltered } = options || {} + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + modifyObjectFields( + cache, + key, + (field, variables, value, details) => { + if (field !== fieldName) return + + // Auto evict filtered values? + if (autoEvictFiltered && isObjectLike(variables)) { + const checkFilter = (filter: string) => { + if (!has(variables, filter)) return false + const val = get(variables, filter) + + // True, if any primitive value (e.g. string, number) && arrays + if (isNullOrUndefined(val)) return false + if (isArray(val)) return true + if (!isObjectLike(val)) return true + return false + } + + const commonFilters = ['query', 'filter', 'search', 'filter.search'] + const hasFilter = commonFilters.some(checkFilter) + + if (hasFilter) { + return details.DELETE + } + } + + // Build helpers & clone value to allow for direct mutation + const createUpdatedValue = ( + updateHandler: (params: { + update: > & string>( + path: Path, + pathUpdate: ( + val: NonUndefined, Path>> + ) => NonUndefined, Path>> + ) => MaybeNullOrUndefined> + }) => void + ) => { + let clonedValue = cloneDeep(value) as ModifyObjectFieldValue + updateHandler({ + update: (path, pathUpdate) => { + clonedValue = updatePathIfExists(clonedValue, path, pathUpdate) + return clonedValue + } + }) + return clonedValue + } + + const getIfExists = < + Path extends Paths> & string + >( + path: Path + ) => getFromPathIfExists, Path>(value, path) + const evict = () => details.DELETE + const readField = < + ReadFieldType extends keyof AllObjectTypes, + ReadFieldName extends keyof AllObjectTypes[ReadFieldType] & string + >( + ref: CacheObjectReference, + fieldName: ReadFieldName + ) => + details.readField( + fieldName, + ref + ) as AllObjectTypes[ReadFieldType][ReadFieldName] + + return updater({ + fieldName: field, + variables, + value, + helpers: { + createUpdatedValue, + get: getIfExists, + evict, + readField, + ref: getObjectReference + } + }) + }, + options + ) +} diff --git a/packages/frontend-2/lib/workspaces/composables/management.ts b/packages/frontend-2/lib/workspaces/composables/management.ts index 10e767fef..cc0fb123c 100644 --- a/packages/frontend-2/lib/workspaces/composables/management.ts +++ b/packages/frontend-2/lib/workspaces/composables/management.ts @@ -3,11 +3,6 @@ import { waitForever, type MaybeAsync, type Optional } from '@speckle/shared' import { useApolloClient, useMutation } from '@vue/apollo-composable' import { graphql } from '~/lib/common/generated/gql' import type { - Query, - QueryWorkspaceArgs, - QueryWorkspaceInviteArgs, - User, - UserWorkspacesArgs, UseWorkspaceInviteManager_PendingWorkspaceCollaboratorFragment, Workspace, WorkspaceCreateInput, @@ -33,7 +28,7 @@ import { processWorkspaceInviteMutation, workspaceUpdateRoleMutation } from '~/lib/workspaces/graphql/mutations' -import { isFunction, isUndefined } from 'lodash-es' +import { isFunction } from 'lodash-es' import type { GraphQLError } from 'graphql' import { useClipboard } from '~~/composables/browser' @@ -143,33 +138,33 @@ export const useProcessWorkspaceInvite = () => { if (accepted) { // Evict Query.workspace - modifyObjectField( + modifyObjectField( cache, ROOT_QUERY, 'workspace', - ({ variables, details: { DELETE } }) => { - if (variables.id === workspaceId) return DELETE + ({ variables, helpers: { evict } }) => { + if (variables.id === workspaceId) return evict() } ) // Evict all User.workspaces - modifyObjectField( + modifyObjectField( cache, getCacheId('User', userId), 'workspaces', - ({ details: { DELETE } }) => DELETE + ({ helpers: { evict } }) => evict() ) } // Set Query.workspaceInvite(id) = null (no invite) - modifyObjectField( + modifyObjectField( cache, ROOT_QUERY, 'workspaceInvite', - ({ value, variables, details: { readField } }) => { + ({ value, variables, helpers: { readField } }) => { if (value) { - const workspaceId = readField('workspaceId', value) - if (workspaceId === workspaceId) return null + const inviteWorkspaceId = readField(value, 'workspaceId') + if (inviteWorkspaceId === workspaceId) return null } else { if (variables.workspaceId === workspaceId) return null } @@ -367,25 +362,18 @@ export function useCreateWorkspace() { if (!workspaceId) return // Navigation to workspace is gonna fetch everything needed for the page, so we only // really need to update workspace fields used in sidebar & settings: User.workspaces - modifyObjectField( + modifyObjectField( cache, getCacheId('User', userId), 'workspaces', - ({ variables, value, details: { DELETE } }) => { - if (variables.filter?.search?.length) return DELETE // evict if filtered search - - const totalCount = isUndefined(value?.totalCount) - ? undefined - : value.totalCount + 1 - const items = isUndefined(value?.items) - ? undefined - : [...value.items, getObjectReference('Workspace', workspaceId)] - - return { - ...value, - totalCount, - items - } + ({ helpers: { createUpdatedValue, ref } }) => { + return createUpdatedValue(({ update }) => { + update('totalCount', (totalCount) => totalCount + 1) + update('items', (items) => [...items, ref('Workspace', workspaceId)]) + }) + }, + { + autoEvictFiltered: true } ) } diff --git a/packages/frontend-2/package.json b/packages/frontend-2/package.json index 7c4740454..624312ed6 100644 --- a/packages/frontend-2/package.json +++ b/packages/frontend-2/package.json @@ -91,6 +91,9 @@ "@eslint/config-inspector": "^0.4.10", "@graphql-codegen/cli": "^5.0.2", "@graphql-codegen/client-preset": "^4.3.0", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/typescript": "^4.0.9", + "@graphql-codegen/visitor-plugin-common": "5.3.1", "@nuxt/devtools": "^1.3.9", "@nuxt/eslint": "^0.3.13", "@nuxtjs/tailwindcss": "^6.3.0", @@ -137,7 +140,7 @@ "stylelint-config-recommended-vue": "^1.4.0", "stylelint-config-standard": "^26.0.0", "tailwindcss": "^3.4.1", - "type-fest": "^3.5.1", + "type-fest": "^4.24.0", "typescript": "^4.8.3", "vue-tsc": "2.0.10", "wait-on": "^6.0.1", diff --git a/packages/frontend-2/tools/gqlCacheHelpersCodegenPlugin.js b/packages/frontend-2/tools/gqlCacheHelpersCodegenPlugin.js new file mode 100644 index 000000000..eaec13485 --- /dev/null +++ b/packages/frontend-2/tools/gqlCacheHelpersCodegenPlugin.js @@ -0,0 +1,59 @@ +const { reduce } = require('lodash') + +const capitalize = (str) => { + return str.charAt(0).toUpperCase() + str.slice(1) +} + +const formatTsTypeName = (gqlTypeName) => { + // Not sure why it gets converted this way in parent types + return gqlTypeName.replace('AI', 'Ai') +} + +/** + * Plugin that adds some extra generated types and type mappings to support better Apollo Cache modification utilities + * @type {import('@graphql-codegen/plugin-helpers').PluginFunction} + */ +const plugin = (schema) => { + /** @type {Record} */ + const objectTypeMap = reduce( + schema.getTypeMap(), + (acc, type, typeName) => { + if (type.astNode?.kind === 'ObjectTypeDefinition') { + acc[typeName] = type + } + return acc + }, + {} + ) + + let output = `export type AllObjectTypes = {\n` + for (const [typeName] of Object.entries(objectTypeMap)) { + output += ` ${typeName}: ${formatTsTypeName(typeName)},\n` + } + output += `}\n` + + for (const [typeName, type] of Object.entries(objectTypeMap)) { + const finalTypeName = formatTsTypeName(typeName) + + output += `export type ${finalTypeName}FieldArgs = {\n` + for (const [fieldName, fieldDef] of Object.entries(type.getFields())) { + const argCount = fieldDef.args.length + const argsName = formatTsTypeName(`${finalTypeName}${capitalize(fieldName)}Args`) + output += ` ${fieldName}: ${argCount ? argsName : '{}'},\n` + } + output += `}\n` + } + + output += `export type AllObjectFieldArgTypes = {\n` + for (const [typeName] of Object.entries(objectTypeMap)) { + const finalTypeName = formatTsTypeName(typeName) + output += ` ${typeName}: ${finalTypeName}FieldArgs,\n` + } + output += `}\n` + + return `${output}\n` +} + +module.exports = { + plugin +} diff --git a/yarn.lock b/yarn.lock index d1e538ad9..2b5943ce0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10205,6 +10205,21 @@ __metadata: languageName: node linkType: hard +"@graphql-codegen/typescript@npm:^4.0.9": + version: 4.0.9 + resolution: "@graphql-codegen/typescript@npm:4.0.9" + dependencies: + "@graphql-codegen/plugin-helpers": "npm:^5.0.4" + "@graphql-codegen/schema-ast": "npm:^4.0.2" + "@graphql-codegen/visitor-plugin-common": "npm:5.3.1" + auto-bind: "npm:~4.0.0" + tslib: "npm:~2.6.0" + peerDependencies: + graphql: ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + checksum: 10/304026adfe622530b8a2827569dd5bbd390177051be8c214fb79873ec64ef21793635c91657703bfd229a3d06f1a8a6f1addd8ae7eab20d1eff2efe6fb044df7 + languageName: node + linkType: hard + "@graphql-codegen/visitor-plugin-common@npm:5.2.0, @graphql-codegen/visitor-plugin-common@npm:^5.0.0, @graphql-codegen/visitor-plugin-common@npm:^5.2.0": version: 5.2.0 resolution: "@graphql-codegen/visitor-plugin-common@npm:5.2.0" @@ -10225,6 +10240,26 @@ __metadata: languageName: node linkType: hard +"@graphql-codegen/visitor-plugin-common@npm:5.3.1": + version: 5.3.1 + resolution: "@graphql-codegen/visitor-plugin-common@npm:5.3.1" + dependencies: + "@graphql-codegen/plugin-helpers": "npm:^5.0.4" + "@graphql-tools/optimize": "npm:^2.0.0" + "@graphql-tools/relay-operation-optimizer": "npm:^7.0.0" + "@graphql-tools/utils": "npm:^10.0.0" + auto-bind: "npm:~4.0.0" + change-case-all: "npm:1.0.15" + dependency-graph: "npm:^0.11.0" + graphql-tag: "npm:^2.11.0" + parse-filepath: "npm:^1.0.2" + tslib: "npm:~2.6.0" + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + checksum: 10/6dd0464d9099d5aeabeb766515fc8dd2fc84bcae4cb0e3653d7f38aea716d6622d35d7cbb57a1954e6bc1cde10f4dd8c4a75ceb4e8bb8cdbba16219615666a5f + languageName: node + linkType: hard + "@graphql-tools/apollo-engine-loader@npm:^8.0.0": version: 8.0.1 resolution: "@graphql-tools/apollo-engine-loader@npm:8.0.1" @@ -14991,6 +15026,9 @@ __metadata: "@eslint/config-inspector": "npm:^0.4.10" "@graphql-codegen/cli": "npm:^5.0.2" "@graphql-codegen/client-preset": "npm:^4.3.0" + "@graphql-codegen/plugin-helpers": "npm:^5.0.4" + "@graphql-codegen/typescript": "npm:^4.0.9" + "@graphql-codegen/visitor-plugin-common": "npm:5.3.1" "@headlessui/vue": "npm:^1.7.13" "@heroicons/vue": "npm:^2.0.12" "@jsonforms/core": "npm:^3.3.0" @@ -15087,7 +15125,7 @@ __metadata: tailwindcss: "npm:^3.4.1" tweetnacl-sealedbox-js: "npm:^1.2.0" tweetnacl-util: "npm:^0.15.1" - type-fest: "npm:^3.5.1" + type-fest: "npm:^4.24.0" typescript: "npm:^4.8.3" ua-parser-js: "npm:^1.0.38" vee-validate: "npm:^4.7.0" @@ -48527,6 +48565,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^4.24.0": + version: 4.24.0 + resolution: "type-fest@npm:4.24.0" + checksum: 10/60efd6ec71f5113ef0a0fcabe61fc722bb2520ea082bc23e4b4dfb44204234dc691560a5e837f939160d7c18b410ed8fae32ddb752d57bed009248e0f61dce6b + languageName: node + linkType: hard + "type-is@npm:^1.6.16, type-is@npm:^1.6.18, type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18"