From b55f12d6bcb8b5a04a99691aab3aad02ff02e22e Mon Sep 17 00:00:00 2001 From: Kristaps Fabians Geikins Date: Mon, 25 Jul 2022 12:24:59 +0300 Subject: [PATCH] feat: apollo client v3 + vue apollo v4 (#831) --- packages/frontend/.eslintrc.js | 7 + packages/frontend/README.md | 14 +- packages/frontend/apollo.config.js | 20 +- .../{ => build-config}/esbuildPlugin.js | 0 packages/frontend/build-config/gqlPlugin.js | 27 + packages/frontend/codegen.yml | 4 +- packages/frontend/package.json | 17 +- packages/frontend/src/bootstrapper.ts | 3 - packages/frontend/src/config/apolloConfig.ts | 222 ++ .../src/config/vueApolloSmartOpsConfig.ts | 35 - packages/frontend/src/graphql/branch.js | 2 +- packages/frontend/src/graphql/comments.ts | 2 +- .../frontend/src/graphql/fragments/user.js | 2 +- .../frontend/src/graphql/generated/graphql.ts | 1552 +--------- packages/frontend/src/graphql/invites.js | 2 +- packages/frontend/src/graphql/server.js | 2 +- packages/frontend/src/graphql/streams.js | 32 +- packages/frontend/src/graphql/user.js | 24 +- packages/frontend/src/graphql/userFeed.gql | 49 - packages/frontend/src/main/App.vue | 11 +- packages/frontend/src/main/app.js | 19 +- .../components/activity/ListItemActivity.vue | 2 +- .../src/main/components/activity/UserPill.vue | 2 +- .../main/components/admin/ActivityCard.vue | 16 +- .../main/components/admin/GeneralInfoCard.vue | 2 +- .../main/components/admin/VersionInfoCard.vue | 2 +- .../components/comments/CommentListItem.vue | 5 +- .../comments/CommentThreadReply.vue | 2 +- .../comments/CommentThreadViewer.vue | 2 +- .../common/CommitReceivedReceipts.vue | 2 +- .../components/common/NoDataPlaceholder.vue | 2 +- .../src/main/components/common/SearchBar.vue | 15 +- .../main/components/common/UserAvatarIcon.vue | 14 +- .../src/main/components/feed/FeedTimeline.vue | 177 +- .../main/components/stream/ListItemCommit.vue | 2 +- .../main/components/stream/StreamActivity.vue | 116 +- .../stream/UserStreamInviteBanners.vue | 6 +- .../main/components/stream/WebhookForm.vue | 2 +- .../stream/collaborators/LeaveStreamPanel.vue | 14 +- .../stream/favorites/StreamFavoriteBtn.vue | 2 +- .../stream/globals/GlobalsBuilder.vue | 10 +- .../stream/uploads/FileProcessingItem.vue | 2 +- .../main/components/user/AppEditDialog.vue | 2 +- .../src/main/components/user/AppNewDialog.vue | 2 +- .../user/ListItemPersonalAccessToken.vue | 2 +- .../main/components/user/ListItemUserApp.vue | 2 +- .../src/main/components/user/TokenDialog.vue | 2 +- .../main/components/user/UserAccessTokens.vue | 2 +- .../src/main/components/user/UserApps.vue | 2 +- .../components/user/UserAuthorisedApps.vue | 2 +- .../main/components/user/UserDeleteCard.vue | 2 +- .../src/main/components/user/UserInfoCard.vue | 2 +- .../components/viewer/CommentAddOverlay.vue | 2 +- .../components/viewer/CommentsOverlay.vue | 10 +- .../components/viewer/ObjectProperties.vue | 2 +- .../main/components/viewer/ViewerBubbles.vue | 2 +- .../components/viewer/dialogs/AllCommits.vue | 67 +- .../viewer/dialogs/AllCommitsBranch.vue | 99 +- .../viewer/dialogs/StreamOverlayViewer.vue | 2 +- .../src/main/dialogs/BranchEditDialog.vue | 2 +- .../frontend/src/main/dialogs/CommitEdit.vue | 2 +- .../src/main/dialogs/InviteDialog.vue | 4 +- .../frontend/src/main/dialogs/NewBranch.vue | 2 +- .../frontend/src/main/dialogs/NewStream.vue | 24 +- .../src/main/dialogs/ShareStreamDialog.vue | 2 +- .../frontend/src/main/layouts/TheAuth.vue | 7 +- .../frontend/src/main/layouts/TheMain.vue | 13 +- .../apollo/helpers/apolloOperationHelper.ts | 21 + .../src/main/lib/core/composables/router.ts | 35 + .../src/main/lib/core/errors/composition.ts | 6 + .../lib/core/helpers/apolloSetupHelper.ts | 63 + .../main/lib/core/mixins/isLoggedInMixin.ts | 9 +- .../lib/stream/mixins/streamInviteMixin.ts | 130 +- .../frontend/src/main/navigation/MainNav.vue | 7 +- .../src/main/navigation/MainNavBottom.vue | 10 - .../src/main/navigation/StreamNav.vue | 2 +- .../frontend/src/main/pages/TheCommits.vue | 89 +- .../src/main/pages/TheFavoriteStreams.vue | 68 +- .../frontend/src/main/pages/TheStreams.vue | 65 +- .../frontend/src/main/pages/admin/Admin.vue | 2 +- .../frontend/src/main/pages/admin/Invites.vue | 25 +- .../src/main/pages/admin/ServerSettings.vue | 13 +- .../frontend/src/main/pages/admin/Streams.vue | 2 +- .../frontend/src/main/pages/admin/Users.vue | 32 +- .../src/main/pages/auth/AuthorizeApp.vue | 2 +- .../pages/auth/ResetPasswordFinalization.vue | 2 +- .../main/pages/auth/ResetPasswordRequest.vue | 2 +- .../frontend/src/main/pages/auth/TheLogin.vue | 2 +- .../src/main/pages/auth/TheRegistration.vue | 2 +- .../src/main/pages/stream/TheActivity.vue | 154 - .../src/main/pages/stream/TheBranch.vue | 122 +- .../main/pages/stream/TheCollaborators.vue | 95 +- .../src/main/pages/stream/TheComments.vue | 4 +- .../src/main/pages/stream/TheGlobals.vue | 2 +- .../src/main/pages/stream/TheSettings.vue | 2 +- .../src/main/pages/stream/TheStream.vue | 27 +- .../src/main/pages/stream/TheStreamHome.vue | 2 +- .../src/main/pages/stream/TheUploads.vue | 2 +- .../src/main/pages/stream/TheWebhooks.vue | 10 +- .../src/main/pages/user/TheProfileUser.vue | 2 +- packages/frontend/src/plugins/authHelpers.js | 2 +- .../src/type-augmentations/apollo.d.ts | 10 + .../vue-apollo-options.d.ts | 26 + .../src/type-augmentations/vue-apollo.d.ts | 14 - .../frontend/src/type-augmentations/vue.d.ts | 7 + packages/frontend/src/vue-apollo.js | 129 - packages/frontend/tsconfig.json | 2 - packages/frontend/vue.config.js | 2 +- .../modules/activitystream/services/index.js | 8 +- yarn.lock | 2543 ++--------------- 110 files changed, 1582 insertions(+), 4875 deletions(-) rename packages/frontend/{ => build-config}/esbuildPlugin.js (100%) create mode 100644 packages/frontend/build-config/gqlPlugin.js create mode 100644 packages/frontend/src/config/apolloConfig.ts delete mode 100644 packages/frontend/src/config/vueApolloSmartOpsConfig.ts delete mode 100644 packages/frontend/src/graphql/userFeed.gql create mode 100644 packages/frontend/src/main/lib/common/apollo/helpers/apolloOperationHelper.ts create mode 100644 packages/frontend/src/main/lib/core/composables/router.ts create mode 100644 packages/frontend/src/main/lib/core/errors/composition.ts create mode 100644 packages/frontend/src/main/lib/core/helpers/apolloSetupHelper.ts delete mode 100644 packages/frontend/src/main/pages/stream/TheActivity.vue create mode 100644 packages/frontend/src/type-augmentations/apollo.d.ts create mode 100644 packages/frontend/src/type-augmentations/vue-apollo-options.d.ts delete mode 100644 packages/frontend/src/type-augmentations/vue-apollo.d.ts delete mode 100644 packages/frontend/src/vue-apollo.js diff --git a/packages/frontend/.eslintrc.js b/packages/frontend/.eslintrc.js index e888f40ef..2a67cf571 100644 --- a/packages/frontend/.eslintrc.js +++ b/packages/frontend/.eslintrc.js @@ -36,6 +36,13 @@ const config = { commonjs: true } }, + { + files: './build-config/**/*.{js, ts}', + env: { + node: true, + commonjs: true + } + }, { files: '*.ts', plugins: ['@typescript-eslint'], diff --git a/packages/frontend/README.md b/packages/frontend/README.md index eeea810f7..302a234b1 100644 --- a/packages/frontend/README.md +++ b/packages/frontend/README.md @@ -38,6 +38,12 @@ Build static build & serve it (for development, otherwise use docker image): yarn build && yarn serve ``` +### Apollo Client + +We're on Apollo Client v3 and Vue Apollo v4 (both the options API and composition API) in this package, so pretty much all of the latest and greatest features are there and ready to be used. + +**Note**: Do not import anything from `@apollo/client`, use `@apollo/client/core` instead! Otherwise you risk bundling in React dependencies, which we definitely do not need! + ### TypeScript This project also supports TypeScript, both in Vue SFCs and outside them. It's preferred that you use it when writing new code and also migrate JS files when there's a good oppurtunity to do so. @@ -52,7 +58,7 @@ Note: If you're defining a Vue component in a non-standard way (e.g. `vueWithMix #### Improved GraphQL DX w/ TS -Run `yarn gqlgen` to generate relevant TS types from the GraphQL Schema (introspected from server which must be running) and operations defined in the frontend. Check this out for more info: https://www.graphql-code-generator.com/plugins/typescript-vue-apollo-smart-ops#examples +Run `yarn gqlgen` to generate relevant TS types from the GraphQL Schema (introspected from server which must be running) and operations defined in the frontend. Afterwards make sure you import them from the generated `graphql.ts` file, not the original file where you defined the operation/fragment. ### Packaging for production @@ -68,6 +74,12 @@ Restart the Vetur Vue Language Server (VLS) through the command palette. Vetur i If you are getting a lot of Property 'xxx' does not exist on type 'CombinedVueInstance' errors, it's an issue with Vue's typing and TypeScript. You can work around it by annotating the return type for each computed/data property, making sure data/props keys are defined even if they're empty. +#### Vue Apollo Options API fetchMore() doesn't update the state/template quickly enough + +This seems to be an issue that appeared after the Apollo Client v2 -> Apollo Client v3 upgrade. It only becomes an issue when you're trying to use vue-infinite-loader with fetchMore(), because the infinite loader triggers an infinite amount of requests with the old cursor, because the cursor hasn't been updated yet at that point. + +The workaround is simple - use the Vue Apollo Composition API fetchMore + ## Community If in trouble, the Speckle Community hangs out on [the forum](https://speckle.community). Do join and introduce yourself! We're happy to help. diff --git a/packages/frontend/apollo.config.js b/packages/frontend/apollo.config.js index 08cdb76b5..1a6ebf732 100644 --- a/packages/frontend/apollo.config.js +++ b/packages/frontend/apollo.config.js @@ -1,23 +1,7 @@ -const path = require('path') - -// Load .env files -const { loadEnv } = require('vue-cli-plugin-apollo/utils/load-env') -const env = loadEnv([ - path.resolve(__dirname, '.env'), - path.resolve(__dirname, '.env.local') -]) - module.exports = { client: { - service: env.VUE_APP_APOLLO_ENGINE_SERVICE, + service: 'speckle-server', + url: 'http://localhost:3000/graphql', includes: ['src/**/*.{js,jsx,ts,tsx,vue,gql}'] - }, - service: { - name: env.VUE_APP_APOLLO_ENGINE_SERVICE, - localSchemaFile: path.resolve(__dirname, './node_modules/.temp/graphql/schema.json') - }, - engine: { - endpoint: process.env.APOLLO_ENGINE_API_ENDPOINT, - apiKey: env.VUE_APP_APOLLO_ENGINE_KEY } } diff --git a/packages/frontend/esbuildPlugin.js b/packages/frontend/build-config/esbuildPlugin.js similarity index 100% rename from packages/frontend/esbuildPlugin.js rename to packages/frontend/build-config/esbuildPlugin.js diff --git a/packages/frontend/build-config/gqlPlugin.js b/packages/frontend/build-config/gqlPlugin.js new file mode 100644 index 000000000..997a9f457 --- /dev/null +++ b/packages/frontend/build-config/gqlPlugin.js @@ -0,0 +1,27 @@ +const TARGET = 'es2019' + +/** + * GQL file support (previously this was managed by the vue apollo cli plugin) + * @param {import('@vue/cli-service/lib/PluginAPI')} api + **/ +function plugin(api) { + api.chainWebpack((config) => { + const gqlRule = config.module.rule('gql').test(/\.(gql|graphql)$/) + + // add caching + gqlRule + .use('cache-loader') + .loader('cache-loader') + .options( + api.genCacheConfig('gql-cache-loader', { + target: TARGET, + graphqltagVersion: require('graphql-tag/package.json').version + }) + ) + + // add gql loader + gqlRule.use('gql-loader').loader('graphql-tag/loader') + }) +} + +module.exports = plugin diff --git a/packages/frontend/codegen.yml b/packages/frontend/codegen.yml index 36706649d..a35b2461b 100644 --- a/packages/frontend/codegen.yml +++ b/packages/frontend/codegen.yml @@ -9,9 +9,7 @@ generates: - 'typescript' - 'typescript-operations' - 'typescript-document-nodes' - - 'typescript-vue-apollo-smart-ops' + - 'typed-document-node' config: - vueApolloErrorHandlerFunction: handleApolloError - vueApolloErrorHandlerFunctionImportFrom: '@/config/vueApolloSmartOpsConfig' scalars: JSONObject: Record diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 0baddb3ab..6ed2bef5b 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -17,6 +17,7 @@ "gqlgen": "graphql-codegen --config codegen.yml" }, "dependencies": { + "@apollo/client": "^3.6.9", "@speckle/viewer": "workspace:^", "@tiptap/core": "^2.0.0-beta.176", "@tiptap/extension-bold": "^2.0.0-beta.26", @@ -33,20 +34,25 @@ "@tiptap/extension-underline": "^2.0.0-beta.23", "@tiptap/vue-2": "^2.0.0-beta.79", "@tryghost/content-api": "^1.5.12", + "@vue/apollo-composable": "^4.0.0-alpha.19", + "@vue/apollo-option": "^4.0.0-alpha.20", "@vuejs-community/vue-filter-date-format": "^1.6.3", "@vuejs-community/vue-filter-date-parse": "^1.1.6", "apexcharts": "^3.33.1", + "apollo-upload-client": "^17.0.0", "dompurify": "^2.3.6", + "graphql": "^15.0.0", + "graphql-tag": "^2.12.6", "lodash": "^4.17.21", "numeral": "^2.0.6", "portal-vue": "^2.1.7", "regenerator-runtime": "^0.13.9", + "subscriptions-transport-ws": "^0.11.0", "tween": "^0.9.0", "uuid": "^8.3.2", "v-tooltip": "^2.0.3", "vue": "^2.7.5", "vue-apexcharts": "^1.6.1", - "vue-apollo": "^3.0.5", "vue-histogram-slider": "^0.3.8", "vue-infinite-loading": "^2.4.5", "vue-mixpanel": "1.0.7", @@ -61,12 +67,13 @@ "devDependencies": { "@graphql-codegen/cli": "2.6.2", "@graphql-codegen/introspection": "2.1.1", + "@graphql-codegen/typed-document-node": "^2.3.1", "@graphql-codegen/typescript": "2.5.1", "@graphql-codegen/typescript-document-nodes": "2.2.13", "@graphql-codegen/typescript-operations": "2.4.2", - "@graphql-codegen/typescript-vue-apollo-smart-ops": "^2.3.1", "@mdi/font": "^5.8.55", "@rushstack/eslint-patch": "^1.1.3", + "@types/apollo-upload-client": "^17.0.1", "@types/dompurify": "^2.3.3", "@types/lodash": "^4.14.180", "@types/mixpanel-browser": "^2.38.0", @@ -88,7 +95,6 @@ "eslint-config-prettier": "^8.5.0", "eslint-loader": "^4.0.2", "eslint-plugin-vue": "^9.2.0", - "graphql-tag": "^2.11.0", "local-web-server": "^5.2.0", "lodash-webpack-plugin": "^0.11.6", "prettier": "^2.5.1", @@ -98,8 +104,6 @@ "type-fest": "^2.13.1", "typescript": "~4.1.5", "vti": "^0.1.5", - "vue-apollo-smart-ops": "^0.2.0-beta.1", - "vue-cli-plugin-apollo": "~0.22.2", "vue-cli-plugin-vuetify": "^2.5.1", "vuetify-loader": "^1.9.1", "webpack": "^4.46.0", @@ -110,7 +114,8 @@ }, "vuePlugins": { "service": [ - "./esbuildPlugin.js" + "./build-config/esbuildPlugin.js", + "./build-config/gqlPlugin.js" ] } } diff --git a/packages/frontend/src/bootstrapper.ts b/packages/frontend/src/bootstrapper.ts index 23e1b3c50..ab301950c 100644 --- a/packages/frontend/src/bootstrapper.ts +++ b/packages/frontend/src/bootstrapper.ts @@ -1,6 +1,3 @@ -// @see https://github.com/Akryum/vue-cli-plugin-apollo/issues/452 -import 'regenerator-runtime/runtime' - import Vue from 'vue' import VTooltip from 'v-tooltip' import VueMixpanel from 'vue-mixpanel' diff --git a/packages/frontend/src/config/apolloConfig.ts b/packages/frontend/src/config/apolloConfig.ts new file mode 100644 index 000000000..ea9a9339e --- /dev/null +++ b/packages/frontend/src/config/apolloConfig.ts @@ -0,0 +1,222 @@ +import Vue from 'vue' +import { createApolloProvider, ApolloProvider } from '@vue/apollo-option' +import { ApolloClient, ApolloLink, InMemoryCache, split } from '@apollo/client/core' +import { setContext } from '@apollo/client/link/context' +import { WebSocketLink } from '@apollo/client/link/ws' +import { SubscriptionClient } from 'subscriptions-transport-ws' +import { LocalStorageKeys } from '@/helpers/mainConstants' +import { createUploadLink } from 'apollo-upload-client' +import { AppLocalStorage } from '@/utils/localStorage' +import { getMainDefinition } from '@apollo/client/utilities' +import { OperationDefinitionNode, Kind } from 'graphql' +import { + buildAbstractCollectionMergeFunction, + incomingOverwritesExistingMergeFunction +} from '@/main/lib/core/helpers/apolloSetupHelper' + +// Name of the localStorage item +const AUTH_TOKEN = LocalStorageKeys.AuthToken +// Http endpoint +const httpEndpoint = `${window.location.origin}/graphql` +// WS endpoint +const wsEndpoint = `${window.location.origin.replace('http', 'ws')}/graphql` +// app version +const appVersion = process.env.SPECKLE_SERVER_VERSION || 'unknown' + +function hasAuthToken() { + return !!AppLocalStorage.get(AUTH_TOKEN) +} + +function createCache(): InMemoryCache { + return new InMemoryCache({ + /** + * This is where you configure how various GQL fields should be read, written to or merged when new data comes in. + * If you define a merge function here, you don't need to duplicate the merge logic inside an `update()` callback + * of a fetchMore call, for example. + * + * Feel free to re-use utilities in `apolloSetupHelper` for defining merge functions or even use the ones that come from `@apollo/client/utilities`. + * + * Read more: https://www.apollographql.com/docs/react/caching/cache-field-behavior + */ + typePolicies: { + Query: { + fields: { + user: { + read(original, { args, toReference }) { + if (args?.id) { + return toReference({ __typename: 'User', id: args.id }) + } + + return original + } + }, + stream: { + read(original, { args, toReference }) { + if (args?.id) { + return toReference({ __typename: 'Stream', id: args.id }) + } + + return original + } + }, + streams: { + keyArgs: false, + merge: buildAbstractCollectionMergeFunction('StreamCollection', { + checkIdentity: true + }) + } + } + }, + User: { + fields: { + timeline: { + keyArgs: false, + merge: buildAbstractCollectionMergeFunction('ActivityCollection') + }, + commits: { + keyArgs: false, + merge: buildAbstractCollectionMergeFunction('CommitCollectionUser', { + checkIdentity: true + }) + }, + favoriteStreams: { + keyArgs: false, + merge: buildAbstractCollectionMergeFunction('StreamCollection', { + checkIdentity: true + }) + } + } + }, + Stream: { + fields: { + activity: { + keyArgs: false, + merge: buildAbstractCollectionMergeFunction('ActivityCollection') + }, + commits: { + keyArgs: false, + merge: buildAbstractCollectionMergeFunction('CommitCollection', { + checkIdentity: true + }) + }, + pendingCollaborators: { + merge: incomingOverwritesExistingMergeFunction + } + } + }, + Branch: { + fields: { + commits: { + keyArgs: false, + merge: buildAbstractCollectionMergeFunction('CommitCollection', { + checkIdentity: true + }) + } + } + }, + BranchCollection: { + merge: true + }, + ServerStats: { + merge: true + }, + WebhookEventCollection: { + merge: true + }, + ServerInfo: { + merge: true + }, + CommentThreadActivityMessage: { + merge: true + } + } + }) +} + +function createWsClient(): SubscriptionClient { + return new SubscriptionClient(wsEndpoint, { + reconnect: true, + connectionParams: () => { + const authToken = AppLocalStorage.get(AUTH_TOKEN) + const Authorization = authToken ? `Bearer ${authToken}` : null + return Authorization ? { Authorization, headers: { Authorization } } : {} + } + }) +} + +function createLink(wsClient?: SubscriptionClient): ApolloLink { + // Prepare links + const httpLink = createUploadLink({ + uri: httpEndpoint + }) + const authLink = setContext(async (_, { headers }) => { + const authToken = AppLocalStorage.get(AUTH_TOKEN) + const authHeader = authToken ? { Authorization: `Bearer ${authToken}` } : {} + return { + headers: { + ...headers, + ...authHeader + } + } + }) + let link = authLink.concat(httpLink) + + if (wsClient) { + const wsLink = new WebSocketLink(wsClient) + link = split( + ({ query }) => { + const definition = getMainDefinition(query) as OperationDefinitionNode + const { kind, operation } = definition + + return kind === Kind.OPERATION_DEFINITION && operation === 'subscription' + }, + wsLink, + link + ) + } + + return link +} + +function createApolloClient() { + const cache = createCache() + const wsClient = createWsClient() + const link = createLink(wsClient) + + const apolloClient = new ApolloClient({ + link, + cache, + ssrForceFetchDelay: 100, + connectToDevTools: process.env.NODE_ENV !== 'production', + name: 'web', + version: appVersion + }) + + return { + apolloClient, + wsClient + } +} + +/** + * Create a Vue Apollo provider instance + */ +export function createProvider(): ApolloProvider { + // Create apollo client + const { apolloClient, wsClient } = createApolloClient() + apolloClient.wsClient = hasAuthToken() ? wsClient : null + + // Create vue apollo provider + const apolloProvider = createApolloProvider({ + defaultClient: apolloClient + }) + + return apolloProvider +} + +export function installVueApollo(apolloProvider: ApolloProvider): void { + // Install apollo provider (it's done weirdly cause it's meant to be used with vue 3) + Vue.config.globalProperties ||= {} + Vue.prototype.$apolloProvider = apolloProvider + apolloProvider.install(Vue) +} diff --git a/packages/frontend/src/config/vueApolloSmartOpsConfig.ts b/packages/frontend/src/config/vueApolloSmartOpsConfig.ts deleted file mode 100644 index 0baeeba48..000000000 --- a/packages/frontend/src/config/vueApolloSmartOpsConfig.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { - ApolloErrorType, - ApolloOperationErrorHandlerFunction, - ProcessedApolloError -} from 'vue-apollo-smart-ops' - -/** - * Error handler used in our auto-generated graphql operation functions - */ -export const handleApolloError: ApolloOperationErrorHandlerFunction = (error) => { - const allErrors: ProcessedApolloError[] = [] - - if (error.networkError) { - const networkError: ProcessedApolloError = { - type: ApolloErrorType.NETWORK_ERROR, - error: error.networkError, - message: error.message - } - allErrors.push(networkError) - } else { - for (const gqlError of error.graphQLErrors || []) { - const basicError: ProcessedApolloError = { - type: ApolloErrorType.SERVER_ERROR, - error: gqlError, - path: gqlError.path, - message: gqlError.message - } - allErrors.push(basicError) - } - } - - return { - allErrors - } -} diff --git a/packages/frontend/src/graphql/branch.js b/packages/frontend/src/graphql/branch.js index d1b96d276..9eff34bf2 100644 --- a/packages/frontend/src/graphql/branch.js +++ b/packages/frontend/src/graphql/branch.js @@ -1,4 +1,4 @@ -import gql from 'graphql-tag' +import { gql } from '@apollo/client/core' export const branchCreatedSubscription = gql` subscription BranchCreated($streamId: String!) { diff --git a/packages/frontend/src/graphql/comments.ts b/packages/frontend/src/graphql/comments.ts index 4bdd49486..f9a49c9b4 100644 --- a/packages/frontend/src/graphql/comments.ts +++ b/packages/frontend/src/graphql/comments.ts @@ -1,4 +1,4 @@ -import gql from 'graphql-tag' +import { gql } from '@apollo/client/core' export const COMMENT_FULL_INFO_FRAGMENT = gql` fragment CommentFullInfo on Comment { diff --git a/packages/frontend/src/graphql/fragments/user.js b/packages/frontend/src/graphql/fragments/user.js index 952d6fb1c..a794ae589 100644 --- a/packages/frontend/src/graphql/fragments/user.js +++ b/packages/frontend/src/graphql/fragments/user.js @@ -1,4 +1,4 @@ -import gql from 'graphql-tag' +import { gql } from '@apollo/client/core' export const limitedUserFieldsFragment = gql` fragment LimitedUserFields on LimitedUser { diff --git a/packages/frontend/src/graphql/generated/graphql.ts b/packages/frontend/src/graphql/generated/graphql.ts index 9bb21fb84..c549df551 100644 --- a/packages/frontend/src/graphql/generated/graphql.ts +++ b/packages/frontend/src/graphql/generated/graphql.ts @@ -1,7 +1,5 @@ import gql from 'graphql-tag'; -import { createMutationFunction, createSmartQueryOptionsFunction, createSmartSubscriptionOptionsFunction } from 'vue-apollo-smart-ops'; -import { ApolloError } from 'apollo-client'; -import { handleApolloError } from '@/config/vueApolloSmartOpsConfig'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; @@ -1655,6 +1653,14 @@ export type StreamWithCollaboratorsQueryVariables = Exact<{ export type StreamWithCollaboratorsQuery = { __typename?: 'Query', stream?: { __typename?: 'Stream', id: string, name: string, isPublic: boolean, role?: string | null, collaborators: Array<{ __typename?: 'StreamCollaborator', id: string, name: string, role: string, company?: string | null, avatar?: string | null }>, pendingCollaborators?: Array<{ __typename?: 'PendingStreamCollaborator', title: string, inviteId: string, role: string, user?: { __typename?: 'LimitedUser', id: string, name?: string | null, bio?: string | null, company?: string | null, avatar?: string | null, verified?: boolean | null } | null }> | null } | null }; +export type StreamWithActivityQueryVariables = Exact<{ + id: Scalars['String']; + cursor?: InputMaybe; +}>; + + +export type StreamWithActivityQuery = { __typename?: 'Query', stream?: { __typename?: 'Stream', id: string, name: string, createdAt: any, commits?: { __typename?: 'CommitCollection', totalCount: number } | null, branches?: { __typename?: 'BranchCollection', totalCount: number } | null, activity?: { __typename?: 'ActivityCollection', totalCount: number, cursor?: string | null, items?: Array<{ __typename?: 'Activity', actionType: string, userId: string, streamId?: string | null, resourceId: string, resourceType: string, time: any, info: Record, message: string } | null> | null } | null } | null }; + export type LeaveStreamMutationVariables = Exact<{ streamId: Scalars['String']; }>; @@ -1712,6 +1718,13 @@ export type AdminUsersListQueryVariables = Exact<{ export type AdminUsersListQuery = { __typename?: 'Query', adminUsers?: { __typename?: 'AdminUsersListCollection', totalCount: number, items: Array<{ __typename?: 'AdminUsersListItem', id: string, registeredUser?: { __typename?: 'User', id: string, suuid?: string | null, email?: string | null, name?: string | null, bio?: string | null, company?: string | null, avatar?: string | null, verified?: boolean | null, profiles?: Record | null, role?: string | null, authorizedApps?: Array<{ __typename?: 'ServerAppListItem', name: string } | null> | null } | null, invitedUser?: { __typename?: 'ServerInvite', id: string, email: string, invitedBy: { __typename?: 'LimitedUser', id: string, name?: string | null } } | null }> } | null }; +export type UserTimelineQueryVariables = Exact<{ + cursor?: InputMaybe; +}>; + + +export type UserTimelineQuery = { __typename?: 'Query', user?: { __typename?: 'User', id: string, timeline?: { __typename?: 'ActivityCollection', totalCount: number, cursor?: string | null, items?: Array<{ __typename?: 'Activity', actionType: string, userId: string, streamId?: string | null, resourceId: string, resourceType: string, time: any, info: Record, message: string } | null> | null } | null } | null }; + export type UserQueryVariables = Exact<{ id: Scalars['String']; }>; @@ -1719,11 +1732,6 @@ export type UserQueryVariables = Exact<{ export type UserQuery = { __typename?: 'Query', user?: { __typename?: 'User', id: string, email?: string | null, name?: string | null, bio?: string | null, company?: string | null, avatar?: string | null, verified?: boolean | null, profiles?: Record | null, role?: string | null, suuid?: string | null } | null }; -export type Unnamed_1_QueryVariables = Exact<{ [key: string]: never; }>; - - -export type Unnamed_1_Query = { __typename?: 'Query', user?: { __typename?: 'User', id: string, email?: string | null, name?: string | null, bio?: string | null, company?: string | null, avatar?: string | null, verified?: boolean | null, profiles?: Record | null, role?: string | null, streams?: { __typename?: 'StreamCollection', totalCount: number, cursor?: string | null, items?: Array<{ __typename?: 'Stream', id: string, name: string, description?: string | null, isPublic: boolean, createdAt: any, updatedAt: any, collaborators: Array<{ __typename?: 'StreamCollaborator', id: string, name: string, company?: string | null, avatar?: string | null, role: string }>, commits?: { __typename?: 'CommitCollection', totalCount: number } | null, branches?: { __typename?: 'BranchCollection', totalCount: number } | null }> | null } | null, commits?: { __typename?: 'CommitCollectionUser', totalCount: number, cursor?: string | null, items?: Array<{ __typename?: 'CommitCollectionUserNode', id: string, message?: string | null, streamId?: string | null, streamName?: string | null, createdAt?: any | null } | null> | null } | null } | null }; - export type UserProfileQueryVariables = Exact<{ id: Scalars['String']; }>; @@ -2122,6 +2130,35 @@ export const StreamWithCollaborators = gql` } ${StreamCollaboratorFields} ${LimitedUserFields}`; +export const StreamWithActivity = gql` + query StreamWithActivity($id: String!, $cursor: DateTime) { + stream(id: $id) { + id + name + createdAt + commits { + totalCount + } + branches { + totalCount + } + activity(cursor: $cursor) { + totalCount + cursor + items { + actionType + userId + streamId + resourceId + resourceType + time + info + message + } + } + } +} + `; export const LeaveStream = gql` mutation LeaveStream($streamId: String!) { streamLeave(streamId: $streamId) @@ -2212,6 +2249,27 @@ export const AdminUsersList = gql` } } `; +export const UserTimeline = gql` + query UserTimeline($cursor: DateTime) { + user { + id + timeline(cursor: $cursor) { + totalCount + cursor + items { + actionType + userId + streamId + resourceId + resourceType + time + info + message + } + } + } +} + `; export const User = gql` query User($id: String!) { user(id: $id) { @@ -2228,7 +2286,6 @@ export const User = gql` } } `; - export const UserProfile = gql` query UserProfile($id: String!) { user(id: $id) { @@ -2291,1438 +2348,45 @@ export const Webhooks = gql` } } `; -export const CommentFullInfoFragmentDoc = gql` - fragment CommentFullInfo on Comment { - id - archived - authorId - text { - doc - attachments { - id - fileName - streamId - fileType - fileSize - } - } - data - screenshot - replies { - totalCount - } - resources { - resourceId - resourceType - } - createdAt - updatedAt - viewedAt -} - `; -export const StreamCollaboratorFieldsFragmentDoc = gql` - fragment StreamCollaboratorFields on StreamCollaborator { - id - name - role - company - avatar -} - `; -export const LimitedUserFieldsFragmentDoc = gql` - fragment LimitedUserFields on LimitedUser { - id - name - bio - company - avatar - verified -} - `; -export const UsersOwnInviteFieldsFragmentDoc = gql` - fragment UsersOwnInviteFields on PendingStreamCollaborator { - id - inviteId - streamId - streamName - token - invitedBy { - ...LimitedUserFields - } -} - ${LimitedUserFieldsFragmentDoc}`; -export const MainServerInfoFieldsFragmentDoc = gql` - fragment MainServerInfoFields on ServerInfo { - name - company - description - adminContact - canonicalUrl - termsOfService - inviteOnly - version -} - `; -export const ServerInfoRolesFieldsFragmentDoc = gql` - fragment ServerInfoRolesFields on ServerInfo { - roles { - name - description - resourceTarget - } -} - `; -export const ServerInfoScopesFieldsFragmentDoc = gql` - fragment ServerInfoScopesFields on ServerInfo { - scopes { - name - description - } -} - `; -export const CommonStreamFieldsFragmentDoc = gql` - fragment CommonStreamFields on Stream { - id - name - description - role - isPublic - createdAt - updatedAt - commentCount - collaborators { - id - name - company - avatar - role - } - commits(limit: 1) { - totalCount - } - branches { - totalCount - } - favoritedDate - favoritesCount -} - `; -export const CommonUserFieldsFragmentDoc = gql` - fragment CommonUserFields on User { - id - suuid - email - name - bio - company - avatar - verified - profiles - role - suuid - streams { - totalCount - } - commits(limit: 1) { - totalCount - items { - id - createdAt - } - } -} - `; -export const StreamWithBranchDocument = gql` - query StreamWithBranch($streamId: String!, $branchName: String!, $cursor: String) { - stream(id: $streamId) { - id - name - branch(name: $branchName) { - id - name - description - commits(cursor: $cursor, limit: 4) { - totalCount - cursor - items { - id - authorName - authorId - authorAvatar - sourceApplication - message - referencedObject - createdAt - commentCount - } - } - } - } -} - `; - -/** - * __useStreamWithBranchQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamWithBranchQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streamWithBranch: useStreamWithBranchQuery({ - * variables: { - * streamId: // value for 'streamId' - * branchName: // value for 'branchName' - * cursor: // value for 'cursor' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamWithBranchQuery = createSmartQueryOptionsFunction< - StreamWithBranchQuery, - StreamWithBranchQueryVariables, - ApolloError ->(StreamWithBranchDocument, handleApolloError); - -export const BranchCreatedDocument = gql` - subscription BranchCreated($streamId: String!) { - branchCreated(streamId: $streamId) -} - `; - -/** - * __useBranchCreatedSubscription__ - * - * To use a Smart Subscription within a Vue component, call `useBranchCreatedSubscription` as the value for a `$subscribe` key - * in the component's `apollo` config, passing any options required for the subscription. - * - * @param options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.subscribe - * - * @example - * { - * apollo: { - * $subscribe: { - * branchCreated: useBranchCreatedSubscription({ - * variables: { - * streamId: // value for 'streamId' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * }, - * } - * } - */ -export const useBranchCreatedSubscription = createSmartSubscriptionOptionsFunction< - BranchCreatedSubscription, - BranchCreatedSubscriptionVariables, - ApolloError ->(BranchCreatedDocument, handleApolloError); - -export const StreamCommitQueryDocument = gql` - query StreamCommitQuery($streamId: String!, $id: String!) { - stream(id: $streamId) { - id - name - role - commit(id: $id) { - id - message - referencedObject - authorName - authorId - authorAvatar - createdAt - branchName - sourceApplication - } - } -} - `; - -/** - * __useStreamCommitQueryQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamCommitQueryQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streamCommitQuery: useStreamCommitQueryQuery({ - * variables: { - * streamId: // value for 'streamId' - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamCommitQueryQuery = createSmartQueryOptionsFunction< - StreamCommitQueryQuery, - StreamCommitQueryQueryVariables, - ApolloError ->(StreamCommitQueryDocument, handleApolloError); - -export const StreamInviteDocument = gql` - query StreamInvite($streamId: String!, $token: String) { - streamInvite(streamId: $streamId, token: $token) { - ...UsersOwnInviteFields - } -} - ${UsersOwnInviteFieldsFragmentDoc}`; - -/** - * __useStreamInviteQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamInviteQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streamInvite: useStreamInviteQuery({ - * variables: { - * streamId: // value for 'streamId' - * token: // value for 'token' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamInviteQuery = createSmartQueryOptionsFunction< - StreamInviteQuery, - StreamInviteQueryVariables, - ApolloError ->(StreamInviteDocument, handleApolloError); - -export const UserStreamInvitesDocument = gql` - query UserStreamInvites { - streamInvites { - ...UsersOwnInviteFields - } -} - ${UsersOwnInviteFieldsFragmentDoc}`; - -/** - * __useUserStreamInvitesQuery__ - * - * To use a Smart Query within a Vue component, call `useUserStreamInvitesQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * userStreamInvites: useUserStreamInvitesQuery({ - * variables: {}, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useUserStreamInvitesQuery = createSmartQueryOptionsFunction< - UserStreamInvitesQuery, - UserStreamInvitesQueryVariables, - ApolloError ->(UserStreamInvitesDocument, handleApolloError); - -export const UseStreamInviteDocument = gql` - mutation UseStreamInvite($accept: Boolean!, $streamId: String!, $token: String!) { - streamInviteUse(accept: $accept, streamId: $streamId, token: $token) -} - `; - -/** - * __useStreamInviteMutation__ - * - * To run a mutation, you call `useStreamInviteMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = useStreamInviteMutation(this, { - * variables: { - * accept: // value for 'accept' - * streamId: // value for 'streamId' - * token: // value for 'token' - * }, - * }); - */ -export const useStreamInviteMutation = createMutationFunction< - UseStreamInviteMutation, - UseStreamInviteMutationVariables, - ApolloError ->(UseStreamInviteDocument, handleApolloError); - -export const CancelStreamInviteDocument = gql` - mutation CancelStreamInvite($streamId: String!, $inviteId: String!) { - streamInviteCancel(streamId: $streamId, inviteId: $inviteId) -} - `; - -/** - * __cancelStreamInviteMutation__ - * - * To run a mutation, you call `cancelStreamInviteMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = cancelStreamInviteMutation(this, { - * variables: { - * streamId: // value for 'streamId' - * inviteId: // value for 'inviteId' - * }, - * }); - */ -export const cancelStreamInviteMutation = createMutationFunction< - CancelStreamInviteMutation, - CancelStreamInviteMutationVariables, - ApolloError ->(CancelStreamInviteDocument, handleApolloError); - -export const DeleteInviteDocument = gql` - mutation DeleteInvite($inviteId: String!) { - inviteDelete(inviteId: $inviteId) -} - `; - -/** - * __deleteInviteMutation__ - * - * To run a mutation, you call `deleteInviteMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = deleteInviteMutation(this, { - * variables: { - * inviteId: // value for 'inviteId' - * }, - * }); - */ -export const deleteInviteMutation = createMutationFunction< - DeleteInviteMutation, - DeleteInviteMutationVariables, - ApolloError ->(DeleteInviteDocument, handleApolloError); - -export const ResendInviteDocument = gql` - mutation ResendInvite($inviteId: String!) { - inviteResend(inviteId: $inviteId) -} - `; - -/** - * __resendInviteMutation__ - * - * To run a mutation, you call `resendInviteMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = resendInviteMutation(this, { - * variables: { - * inviteId: // value for 'inviteId' - * }, - * }); - */ -export const resendInviteMutation = createMutationFunction< - ResendInviteMutation, - ResendInviteMutationVariables, - ApolloError ->(ResendInviteDocument, handleApolloError); - -export const BatchInviteToServerDocument = gql` - mutation BatchInviteToServer($paramsArray: [ServerInviteCreateInput!]!) { - serverInviteBatchCreate(input: $paramsArray) -} - `; - -/** - * __batchInviteToServerMutation__ - * - * To run a mutation, you call `batchInviteToServerMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = batchInviteToServerMutation(this, { - * variables: { - * paramsArray: // value for 'paramsArray' - * }, - * }); - */ -export const batchInviteToServerMutation = createMutationFunction< - BatchInviteToServerMutation, - BatchInviteToServerMutationVariables, - ApolloError ->(BatchInviteToServerDocument, handleApolloError); - -export const BatchInviteToStreamsDocument = gql` - mutation BatchInviteToStreams($paramsArray: [StreamInviteCreateInput!]!) { - streamInviteBatchCreate(input: $paramsArray) -} - `; - -/** - * __batchInviteToStreamsMutation__ - * - * To run a mutation, you call `batchInviteToStreamsMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = batchInviteToStreamsMutation(this, { - * variables: { - * paramsArray: // value for 'paramsArray' - * }, - * }); - */ -export const batchInviteToStreamsMutation = createMutationFunction< - BatchInviteToStreamsMutation, - BatchInviteToStreamsMutationVariables, - ApolloError ->(BatchInviteToStreamsDocument, handleApolloError); - -export const StreamObjectDocument = gql` - query StreamObject($streamId: String!, $id: String!) { - stream(id: $streamId) { - id - object(id: $id) { - totalChildrenCount - id - speckleType - data - } - } -} - `; - -/** - * __useStreamObjectQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamObjectQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streamObject: useStreamObjectQuery({ - * variables: { - * streamId: // value for 'streamId' - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamObjectQuery = createSmartQueryOptionsFunction< - StreamObjectQuery, - StreamObjectQueryVariables, - ApolloError ->(StreamObjectDocument, handleApolloError); - -export const StreamObjectNoDataDocument = gql` - query StreamObjectNoData($streamId: String!, $id: String!) { - stream(id: $streamId) { - id - name - object(id: $id) { - totalChildrenCount - id - speckleType - } - } -} - `; - -/** - * __useStreamObjectNoDataQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamObjectNoDataQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streamObjectNoData: useStreamObjectNoDataQuery({ - * variables: { - * streamId: // value for 'streamId' - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamObjectNoDataQuery = createSmartQueryOptionsFunction< - StreamObjectNoDataQuery, - StreamObjectNoDataQueryVariables, - ApolloError ->(StreamObjectNoDataDocument, handleApolloError); - -export const MainServerInfoDocument = gql` - query MainServerInfo { - serverInfo { - ...MainServerInfoFields - } -} - ${MainServerInfoFieldsFragmentDoc}`; - -/** - * __useMainServerInfoQuery__ - * - * To use a Smart Query within a Vue component, call `useMainServerInfoQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * mainServerInfo: useMainServerInfoQuery({ - * variables: {}, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useMainServerInfoQuery = createSmartQueryOptionsFunction< - MainServerInfoQuery, - MainServerInfoQueryVariables, - ApolloError ->(MainServerInfoDocument, handleApolloError); - -export const FullServerInfoDocument = gql` - query FullServerInfo { - serverInfo { - ...MainServerInfoFields - ...ServerInfoRolesFields - ...ServerInfoScopesFields - } -} - ${MainServerInfoFieldsFragmentDoc} -${ServerInfoRolesFieldsFragmentDoc} -${ServerInfoScopesFieldsFragmentDoc}`; - -/** - * __useFullServerInfoQuery__ - * - * To use a Smart Query within a Vue component, call `useFullServerInfoQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * fullServerInfo: useFullServerInfoQuery({ - * variables: {}, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useFullServerInfoQuery = createSmartQueryOptionsFunction< - FullServerInfoQuery, - FullServerInfoQueryVariables, - ApolloError ->(FullServerInfoDocument, handleApolloError); - -export const StreamCommitsDocument = gql` - query StreamCommits($id: String!) { - stream(id: $id) { - id - role - commits { - totalCount - items { - id - authorId - authorName - authorAvatar - createdAt - message - referencedObject - branchName - sourceApplication - } - } - } -} - `; - -/** - * __useStreamCommitsQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamCommitsQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streamCommits: useStreamCommitsQuery({ - * variables: { - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamCommitsQuery = createSmartQueryOptionsFunction< - StreamCommitsQuery, - StreamCommitsQueryVariables, - ApolloError ->(StreamCommitsDocument, handleApolloError); - -export const StreamsDocument = gql` - query Streams($cursor: String) { - streams(cursor: $cursor, limit: 10) { - totalCount - cursor - items { - id - name - description - role - isPublic - createdAt - updatedAt - commentCount - collaborators { - id - name - company - avatar - role - } - commits(limit: 1) { - totalCount - items { - id - createdAt - message - authorId - branchName - authorName - authorAvatar - referencedObject - } - } - branches { - totalCount - } - favoritedDate - favoritesCount - } - } -} - `; - -/** - * __useStreamsQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamsQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streams: useStreamsQuery({ - * variables: { - * cursor: // value for 'cursor' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamsQuery = createSmartQueryOptionsFunction< - StreamsQuery, - StreamsQueryVariables, - ApolloError ->(StreamsDocument, handleApolloError); - -export const StreamDocument = gql` - query Stream($id: String!) { - stream(id: $id) { - ...CommonStreamFields - } -} - ${CommonStreamFieldsFragmentDoc}`; - -/** - * __useStreamQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * stream: useStreamQuery({ - * variables: { - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamQuery = createSmartQueryOptionsFunction< - StreamQuery, - StreamQueryVariables, - ApolloError ->(StreamDocument, handleApolloError); - -export const StreamWithCollaboratorsDocument = gql` - query StreamWithCollaborators($id: String!) { - stream(id: $id) { - id - name - isPublic - role - collaborators { - ...StreamCollaboratorFields - } - pendingCollaborators { - title - inviteId - role - user { - ...LimitedUserFields - } - } - } -} - ${StreamCollaboratorFieldsFragmentDoc} -${LimitedUserFieldsFragmentDoc}`; - -/** - * __useStreamWithCollaboratorsQuery__ - * - * To use a Smart Query within a Vue component, call `useStreamWithCollaboratorsQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * streamWithCollaborators: useStreamWithCollaboratorsQuery({ - * variables: { - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useStreamWithCollaboratorsQuery = createSmartQueryOptionsFunction< - StreamWithCollaboratorsQuery, - StreamWithCollaboratorsQueryVariables, - ApolloError ->(StreamWithCollaboratorsDocument, handleApolloError); - -export const LeaveStreamDocument = gql` - mutation LeaveStream($streamId: String!) { - streamLeave(streamId: $streamId) -} - `; - -/** - * __leaveStreamMutation__ - * - * To run a mutation, you call `leaveStreamMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = leaveStreamMutation(this, { - * variables: { - * streamId: // value for 'streamId' - * }, - * }); - */ -export const leaveStreamMutation = createMutationFunction< - LeaveStreamMutation, - LeaveStreamMutationVariables, - ApolloError ->(LeaveStreamDocument, handleApolloError); - -export const UpdateStreamPermissionDocument = gql` - mutation UpdateStreamPermission($params: StreamUpdatePermissionInput!) { - streamUpdatePermission(permissionParams: $params) -} - `; - -/** - * __updateStreamPermissionMutation__ - * - * To run a mutation, you call `updateStreamPermissionMutation` within a Vue component and pass it - * your Vue app instance along with any options that fit your needs. - * - * @param app, a reference to your Vue app instance (which must have a `$apollo` property) - * @param options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate - * @param client (optional), which can be an instance of `DollarApollo` or the `mutate()` function provided by an `` component - * - * @example - * const { success, data, errors } = updateStreamPermissionMutation(this, { - * variables: { - * params: // value for 'params' - * }, - * }); - */ -export const updateStreamPermissionMutation = createMutationFunction< - UpdateStreamPermissionMutation, - UpdateStreamPermissionMutationVariables, - ApolloError ->(UpdateStreamPermissionDocument, handleApolloError); - -export const UserFavoriteStreamsDocument = gql` - query UserFavoriteStreams($cursor: String) { - user { - ...CommonUserFields - favoriteStreams(cursor: $cursor, limit: 10) { - totalCount - cursor - items { - ...CommonStreamFields - } - } - } -} - ${CommonUserFieldsFragmentDoc} -${CommonStreamFieldsFragmentDoc}`; - -/** - * __useUserFavoriteStreamsQuery__ - * - * To use a Smart Query within a Vue component, call `useUserFavoriteStreamsQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * userFavoriteStreams: useUserFavoriteStreamsQuery({ - * variables: { - * cursor: // value for 'cursor' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useUserFavoriteStreamsQuery = createSmartQueryOptionsFunction< - UserFavoriteStreamsQuery, - UserFavoriteStreamsQueryVariables, - ApolloError ->(UserFavoriteStreamsDocument, handleApolloError); - -export const MainUserDataDocument = gql` - query MainUserData { - user { - ...CommonUserFields - } -} - ${CommonUserFieldsFragmentDoc}`; - -/** - * __useMainUserDataQuery__ - * - * To use a Smart Query within a Vue component, call `useMainUserDataQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * mainUserData: useMainUserDataQuery({ - * variables: {}, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useMainUserDataQuery = createSmartQueryOptionsFunction< - MainUserDataQuery, - MainUserDataQueryVariables, - ApolloError ->(MainUserDataDocument, handleApolloError); - -export const ExtraUserDataDocument = gql` - query ExtraUserData { - user { - ...CommonUserFields - totalOwnedStreamsFavorites - } -} - ${CommonUserFieldsFragmentDoc}`; - -/** - * __useExtraUserDataQuery__ - * - * To use a Smart Query within a Vue component, call `useExtraUserDataQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * extraUserData: useExtraUserDataQuery({ - * variables: {}, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useExtraUserDataQuery = createSmartQueryOptionsFunction< - ExtraUserDataQuery, - ExtraUserDataQueryVariables, - ApolloError ->(ExtraUserDataDocument, handleApolloError); - -export const UserSearchDocument = gql` - query UserSearch($query: String!, $limit: Int!, $cursor: String, $archived: Boolean) { - userSearch(query: $query, limit: $limit, cursor: $cursor, archived: $archived) { - cursor - items { - ...LimitedUserFields - } - } -} - ${LimitedUserFieldsFragmentDoc}`; - -/** - * __useUserSearchQuery__ - * - * To use a Smart Query within a Vue component, call `useUserSearchQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * userSearch: useUserSearchQuery({ - * variables: { - * query: // value for 'query' - * limit: // value for 'limit' - * cursor: // value for 'cursor' - * archived: // value for 'archived' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useUserSearchQuery = createSmartQueryOptionsFunction< - UserSearchQuery, - UserSearchQueryVariables, - ApolloError ->(UserSearchDocument, handleApolloError); - -export const IsLoggedInDocument = gql` - query IsLoggedIn { - user { - id - } -} - `; - -/** - * __useIsLoggedInQuery__ - * - * To use a Smart Query within a Vue component, call `useIsLoggedInQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * isLoggedIn: useIsLoggedInQuery({ - * variables: {}, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useIsLoggedInQuery = createSmartQueryOptionsFunction< - IsLoggedInQuery, - IsLoggedInQueryVariables, - ApolloError ->(IsLoggedInDocument, handleApolloError); - -export const AdminUsersListDocument = gql` - query AdminUsersList($limit: Int, $offset: Int, $query: String) { - adminUsers(limit: $limit, offset: $offset, query: $query) { - totalCount - items { - id - registeredUser { - id - suuid - email - name - bio - company - avatar - verified - profiles - role - authorizedApps { - name - } - } - invitedUser { - id - email - invitedBy { - id - name - } - } - } - } -} - `; - -/** - * __useAdminUsersListQuery__ - * - * To use a Smart Query within a Vue component, call `useAdminUsersListQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * adminUsersList: useAdminUsersListQuery({ - * variables: { - * limit: // value for 'limit' - * offset: // value for 'offset' - * query: // value for 'query' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useAdminUsersListQuery = createSmartQueryOptionsFunction< - AdminUsersListQuery, - AdminUsersListQueryVariables, - ApolloError ->(AdminUsersListDocument, handleApolloError); - -export const UserDocument = gql` - query User($id: String!) { - user(id: $id) { - id - email - name - bio - company - avatar - verified - profiles - role - suuid - } -} - `; - -/** - * __useUserQuery__ - * - * To use a Smart Query within a Vue component, call `useUserQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * user: useUserQuery({ - * variables: { - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useUserQuery = createSmartQueryOptionsFunction< - UserQuery, - UserQueryVariables, - ApolloError ->(UserDocument, handleApolloError); - -export const Document = gql` - { - user { - id - email - name - bio - company - avatar - verified - profiles - role - streams(limit: 25) { - totalCount - cursor - items { - id - name - description - isPublic - createdAt - updatedAt - collaborators { - id - name - company - avatar - role - } - commits { - totalCount - } - branches { - totalCount - } - } - } - commits(limit: 25) { - totalCount - cursor - items { - id - message - streamId - streamName - createdAt - } - } - } -} - `; -export const UserProfileDocument = gql` - query UserProfile($id: String!) { - user(id: $id) { - id - name - bio - company - avatar - verified - } -} - `; - -/** - * __useUserProfileQuery__ - * - * To use a Smart Query within a Vue component, call `useUserProfileQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * userProfile: useUserProfileQuery({ - * variables: { - * id: // value for 'id' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useUserProfileQuery = createSmartQueryOptionsFunction< - UserProfileQuery, - UserProfileQueryVariables, - ApolloError ->(UserProfileDocument, handleApolloError); - -export const WebhookDocument = gql` - query webhook($streamId: String!, $webhookId: String!) { - stream(id: $streamId) { - id - role - webhooks(id: $webhookId) { - items { - id - streamId - url - description - triggers - enabled - history(limit: 1) { - items { - status - statusInfo - } - } - } - } - } -} - `; - -/** - * __useWebhookQuery__ - * - * To use a Smart Query within a Vue component, call `useWebhookQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * webhook: useWebhookQuery({ - * variables: { - * streamId: // value for 'streamId' - * webhookId: // value for 'webhookId' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useWebhookQuery = createSmartQueryOptionsFunction< - WebhookQuery, - WebhookQueryVariables, - ApolloError ->(WebhookDocument, handleApolloError); - -export const WebhooksDocument = gql` - query webhooks($streamId: String!) { - stream(id: $streamId) { - id - name - role - webhooks { - items { - id - streamId - url - description - triggers - enabled - history(limit: 50) { - items { - status - statusInfo - lastUpdate - } - } - } - } - } -} - `; - -/** - * __useWebhooksQuery__ - * - * To use a Smart Query within a Vue component, call `useWebhooksQuery` as the value for a query key - * in the component's `apollo` config, passing any options required for the query. - * - * @param options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.query - * - * @example - * { - * apollo: { - * webhooks: useWebhooksQuery({ - * variables: { - * streamId: // value for 'streamId' - * }, - * loadingKey: 'loading', - * fetchPolicy: 'no-cache', - * }), - * } - * } - */ -export const useWebhooksQuery = createSmartQueryOptionsFunction< - WebhooksQuery, - WebhooksQueryVariables, - ApolloError ->(WebhooksDocument, handleApolloError); +export const CommentFullInfoFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommentFullInfo"},"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":"archived"}},{"kind":"Field","name":{"kind":"Name","value":"authorId"}},{"kind":"Field","name":{"kind":"Name","value":"text"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"doc"}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fileName"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"fileSize"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"screenshot"}},{"kind":"Field","name":{"kind":"Name","value":"replies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"resources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resourceId"}},{"kind":"Field","name":{"kind":"Name","value":"resourceType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}}]} as unknown as DocumentNode; +export const StreamCollaboratorFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"StreamCollaboratorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StreamCollaborator"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}}]}}]} as unknown as DocumentNode; +export const LimitedUserFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LimitedUserFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LimitedUser"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}}]}}]} as unknown as DocumentNode; +export const UsersOwnInviteFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UsersOwnInviteFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PendingStreamCollaborator"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inviteId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"streamName"}},{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"invitedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LimitedUserFields"}}]}}]}},...LimitedUserFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const MainServerInfoFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MainServerInfoFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ServerInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"adminContact"}},{"kind":"Field","name":{"kind":"Name","value":"canonicalUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfService"}},{"kind":"Field","name":{"kind":"Name","value":"inviteOnly"}},{"kind":"Field","name":{"kind":"Name","value":"version"}}]}}]} as unknown as DocumentNode; +export const ServerInfoRolesFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ServerInfoRolesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ServerInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"roles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"resourceTarget"}}]}}]}}]} as unknown as DocumentNode; +export const ServerInfoScopesFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ServerInfoScopesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ServerInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scopes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}}]} as unknown as DocumentNode; +export const CommonStreamFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommonStreamFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Stream"}},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"isPublic"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"commentCount"}},{"kind":"Field","name":{"kind":"Name","value":"collaborators"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commits"},"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":"Field","name":{"kind":"Name","value":"branches"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"favoritedDate"}},{"kind":"Field","name":{"kind":"Name","value":"favoritesCount"}}]}}]} as unknown as DocumentNode; +export const CommonUserFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommonUserFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"suuid"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"profiles"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"suuid"}},{"kind":"Field","name":{"kind":"Name","value":"streams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commits"},"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":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode; +export const StreamWithBranchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamWithBranch"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"branchName"}},"type":{"kind":"NonNullType","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"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"branch"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"branchName"}}}],"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":"commits"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"4"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"authorName"}},{"kind":"Field","name":{"kind":"Name","value":"authorId"}},{"kind":"Field","name":{"kind":"Name","value":"authorAvatar"}},{"kind":"Field","name":{"kind":"Name","value":"sourceApplication"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"commentCount"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const BranchCreatedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"BranchCreated"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"branchCreated"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}]}]}}]} as unknown as DocumentNode; +export const StreamCommitQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamCommitQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"commit"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}},{"kind":"Field","name":{"kind":"Name","value":"authorName"}},{"kind":"Field","name":{"kind":"Name","value":"authorId"}},{"kind":"Field","name":{"kind":"Name","value":"authorAvatar"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"branchName"}},{"kind":"Field","name":{"kind":"Name","value":"sourceApplication"}}]}}]}}]}}]} as unknown as DocumentNode; +export const StreamInviteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamInvite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamInvite"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}},{"kind":"Argument","name":{"kind":"Name","value":"token"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UsersOwnInviteFields"}}]}}]}},...UsersOwnInviteFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const UserStreamInvitesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserStreamInvites"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamInvites"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UsersOwnInviteFields"}}]}}]}},...UsersOwnInviteFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const UseStreamInviteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UseStreamInvite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accept"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamInviteUse"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accept"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accept"}}},{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}},{"kind":"Argument","name":{"kind":"Name","value":"token"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}}]}]}}]} as unknown as DocumentNode; +export const CancelStreamInviteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelStreamInvite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inviteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamInviteCancel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}},{"kind":"Argument","name":{"kind":"Name","value":"inviteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inviteId"}}}]}]}}]} as unknown as DocumentNode; +export const DeleteInviteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteInvite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inviteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"inviteDelete"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inviteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inviteId"}}}]}]}}]} as unknown as DocumentNode; +export const ResendInviteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResendInvite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inviteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"inviteResend"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inviteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inviteId"}}}]}]}}]} as unknown as DocumentNode; +export const BatchInviteToServerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"BatchInviteToServer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"paramsArray"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ServerInviteCreateInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"serverInviteBatchCreate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"paramsArray"}}}]}]}}]} as unknown as DocumentNode; +export const BatchInviteToStreamsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"BatchInviteToStreams"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"paramsArray"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StreamInviteCreateInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamInviteBatchCreate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"paramsArray"}}}]}]}}]} as unknown as DocumentNode; +export const StreamObjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamObject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"object"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalChildrenCount"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"speckleType"}},{"kind":"Field","name":{"kind":"Name","value":"data"}}]}}]}}]}}]} as unknown as DocumentNode; +export const StreamObjectNoDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamObjectNoData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"object"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalChildrenCount"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"speckleType"}}]}}]}}]}}]} as unknown as DocumentNode; +export const MainServerInfoDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MainServerInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"serverInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MainServerInfoFields"}}]}}]}},...MainServerInfoFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const FullServerInfoDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FullServerInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"serverInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MainServerInfoFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ServerInfoRolesFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ServerInfoScopesFields"}}]}}]}},...MainServerInfoFieldsFragmentDoc.definitions,...ServerInfoRolesFieldsFragmentDoc.definitions,...ServerInfoScopesFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const StreamCommitsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamCommits"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"commits"},"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":"Field","name":{"kind":"Name","value":"authorId"}},{"kind":"Field","name":{"kind":"Name","value":"authorName"}},{"kind":"Field","name":{"kind":"Name","value":"authorAvatar"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}},{"kind":"Field","name":{"kind":"Name","value":"branchName"}},{"kind":"Field","name":{"kind":"Name","value":"sourceApplication"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const StreamsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Streams"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streams"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"isPublic"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"commentCount"}},{"kind":"Field","name":{"kind":"Name","value":"collaborators"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commits"},"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":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"authorId"}},{"kind":"Field","name":{"kind":"Name","value":"branchName"}},{"kind":"Field","name":{"kind":"Name","value":"authorName"}},{"kind":"Field","name":{"kind":"Name","value":"authorAvatar"}},{"kind":"Field","name":{"kind":"Name","value":"referencedObject"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"branches"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"favoritedDate"}},{"kind":"Field","name":{"kind":"Name","value":"favoritesCount"}}]}}]}}]}}]} as unknown as DocumentNode; +export const StreamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Stream"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommonStreamFields"}}]}}]}},...CommonStreamFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const StreamWithCollaboratorsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamWithCollaborators"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isPublic"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"collaborators"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"StreamCollaboratorFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pendingCollaborators"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"inviteId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LimitedUserFields"}}]}}]}}]}}]}},...StreamCollaboratorFieldsFragmentDoc.definitions,...LimitedUserFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const StreamWithActivityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"StreamWithActivity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","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":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"commits"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"branches"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"activity"},"arguments":[{"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":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"actionType"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"resourceId"}},{"kind":"Field","name":{"kind":"Name","value":"resourceType"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"info"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const LeaveStreamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"LeaveStream"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamLeave"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}]}]}}]} as unknown as DocumentNode; +export const UpdateStreamPermissionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateStreamPermission"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"params"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StreamUpdatePermissionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamUpdatePermission"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"permissionParams"},"value":{"kind":"Variable","name":{"kind":"Name","value":"params"}}}]}]}}]} as unknown as DocumentNode; +export const UserFavoriteStreamsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserFavoriteStreams"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommonUserFields"}},{"kind":"Field","name":{"kind":"Name","value":"favoriteStreams"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommonStreamFields"}}]}}]}}]}}]}},...CommonUserFieldsFragmentDoc.definitions,...CommonStreamFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const MainUserDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MainUserData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommonUserFields"}}]}}]}},...CommonUserFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const ExtraUserDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ExtraUserData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommonUserFields"}},{"kind":"Field","name":{"kind":"Name","value":"totalOwnedStreamsFavorites"}}]}}]}},...CommonUserFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const UserSearchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserSearch"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"archived"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userSearch"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"archived"},"value":{"kind":"Variable","name":{"kind":"Name","value":"archived"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LimitedUserFields"}}]}}]}}]}},...LimitedUserFieldsFragmentDoc.definitions]} as unknown as DocumentNode; +export const IsLoggedInDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"IsLoggedIn"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; +export const AdminUsersListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AdminUsersList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminUsers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}},{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"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":"Field","name":{"kind":"Name","value":"registeredUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"suuid"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"profiles"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"authorizedApps"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"invitedUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"invitedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const UserTimelineDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserTimeline"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"timeline"},"arguments":[{"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":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"actionType"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"resourceId"}},{"kind":"Field","name":{"kind":"Name","value":"resourceType"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"info"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const UserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"User"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"profiles"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"suuid"}}]}}]}}]} as unknown as DocumentNode; +export const UserProfileDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserProfile"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}}]}}]}}]} as unknown as DocumentNode; +export const WebhookDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"webhook"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"webhookId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"webhooks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"webhookId"}}}],"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":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"history"},"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":"status"}},{"kind":"Field","name":{"kind":"Name","value":"statusInfo"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const WebhooksDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"webhooks"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"webhooks"},"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":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"triggers"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"history"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"50"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"statusInfo"}},{"kind":"Field","name":{"kind":"Name","value":"lastUpdate"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/frontend/src/graphql/invites.js b/packages/frontend/src/graphql/invites.js index 3f76ce5c9..651aaf4f2 100644 --- a/packages/frontend/src/graphql/invites.js +++ b/packages/frontend/src/graphql/invites.js @@ -1,4 +1,4 @@ -import gql from 'graphql-tag' +import { gql } from '@apollo/client/core' import { usersOwnInviteFieldsFragment } from '@/graphql/fragments/user' export const streamInviteQuery = gql` diff --git a/packages/frontend/src/graphql/server.js b/packages/frontend/src/graphql/server.js index e84b49497..7212f01e8 100644 --- a/packages/frontend/src/graphql/server.js +++ b/packages/frontend/src/graphql/server.js @@ -1,4 +1,4 @@ -import gql from 'graphql-tag' +import { gql } from '@apollo/client/core' export const mainServerInfoFieldsFragment = gql` fragment MainServerInfoFields on ServerInfo { diff --git a/packages/frontend/src/graphql/streams.js b/packages/frontend/src/graphql/streams.js index 6b3c59874..612961c91 100644 --- a/packages/frontend/src/graphql/streams.js +++ b/packages/frontend/src/graphql/streams.js @@ -2,7 +2,7 @@ import { limitedUserFieldsFragment, streamCollaboratorFieldsFragment } from '@/graphql/fragments/user' -import gql from 'graphql-tag' +import { gql } from '@apollo/client/core' /** * Common stream fields when querying for streams @@ -75,6 +75,36 @@ export const streamWithCollaboratorsQuery = gql` ${streamCollaboratorFieldsFragment} ` +export const streamWithActivityQuery = gql` + query StreamWithActivity($id: String!, $cursor: DateTime) { + stream(id: $id) { + id + name + createdAt + commits { + totalCount + } + branches { + totalCount + } + activity(cursor: $cursor) { + totalCount + cursor + items { + actionType + userId + streamId + resourceId + resourceType + time + info + message + } + } + } + } +` + /** * Remove authenticated user from the collaborators list */ diff --git a/packages/frontend/src/graphql/user.js b/packages/frontend/src/graphql/user.js index 2e6928c29..7a305c0c6 100644 --- a/packages/frontend/src/graphql/user.js +++ b/packages/frontend/src/graphql/user.js @@ -1,6 +1,6 @@ import { limitedUserFieldsFragment } from '@/graphql/fragments/user' import { commonStreamFieldsFragment } from '@/graphql/streams' -import gql from 'graphql-tag' +import { gql } from '@apollo/client/core' export const commonUserFieldsFragment = gql` fragment CommonUserFields on User { @@ -139,3 +139,25 @@ export const adminUsersListQuery = gql` } } ` + +export const userTimelineQuery = gql` + query UserTimeline($cursor: DateTime) { + user { + id + timeline(cursor: $cursor) { + totalCount + cursor + items { + actionType + userId + streamId + resourceId + resourceType + time + info + message + } + } + } + } +` diff --git a/packages/frontend/src/graphql/userFeed.gql b/packages/frontend/src/graphql/userFeed.gql deleted file mode 100644 index d9151eb96..000000000 --- a/packages/frontend/src/graphql/userFeed.gql +++ /dev/null @@ -1,49 +0,0 @@ -query { - user { - id - email - name - bio - company - avatar - verified - profiles - role - streams(limit: 25) { - totalCount - cursor - items { - id - name - description - isPublic - createdAt - updatedAt - collaborators { - id - name - company - avatar - role - } - commits { - totalCount - } - branches { - totalCount - } - } - } - commits(limit: 25) { - totalCount - cursor - items { - id - message - streamId - streamName - createdAt - } - } - } -} diff --git a/packages/frontend/src/main/App.vue b/packages/frontend/src/main/App.vue index c24e24246..13c999df6 100644 --- a/packages/frontend/src/main/App.vue +++ b/packages/frontend/src/main/App.vue @@ -2,16 +2,7 @@