Skip to content

Commit

Permalink
GraphQL and TS for fetching and editing buckets (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
nl0 authored Jun 30, 2021
1 parent 3c56e4f commit af354f4
Show file tree
Hide file tree
Showing 32 changed files with 1,330 additions and 472 deletions.
51 changes: 51 additions & 0 deletions catalog/app/containers/Admin/BucketConfigSelection.generated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'
import * as Types from '../../model/graphql/types.generated'

export type BucketConfigSelectionFragment = {
readonly __typename: 'BucketConfig'
} & Pick<
Types.BucketConfig,
| 'name'
| 'title'
| 'iconUrl'
| 'description'
| 'relevanceScore'
| 'overviewUrl'
| 'tags'
| 'linkedData'
| 'fileExtensionsToIndex'
| 'scannerParallelShardsDepth'
| 'snsNotificationArn'
| 'skipMetaDataIndexing'
| 'lastIndexed'
>

export const BucketConfigSelectionFragmentDoc = ({
kind: 'Document',
definitions: [
{
kind: 'FragmentDefinition',
name: { kind: 'Name', value: 'BucketConfigSelection' },
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'BucketConfig' } },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
{ kind: 'Field', name: { kind: 'Name', value: 'iconUrl' } },
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
{ kind: 'Field', name: { kind: 'Name', value: 'relevanceScore' } },
{ kind: 'Field', name: { kind: 'Name', value: 'overviewUrl' } },
{ kind: 'Field', name: { kind: 'Name', value: 'tags' } },
{ kind: 'Field', name: { kind: 'Name', value: 'linkedData' } },
{ kind: 'Field', name: { kind: 'Name', value: 'fileExtensionsToIndex' } },
{ kind: 'Field', name: { kind: 'Name', value: 'scannerParallelShardsDepth' } },
{ kind: 'Field', name: { kind: 'Name', value: 'snsNotificationArn' } },
{ kind: 'Field', name: { kind: 'Name', value: 'skipMetaDataIndexing' } },
{ kind: 'Field', name: { kind: 'Name', value: 'lastIndexed' } },
],
},
},
],
} as unknown) as DocumentNode<BucketConfigSelectionFragment, unknown>
15 changes: 15 additions & 0 deletions catalog/app/containers/Admin/BucketConfigSelection.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
fragment BucketConfigSelection on BucketConfig {
name
title
iconUrl
description
relevanceScore
overviewUrl
tags
linkedData
fileExtensionsToIndex
scannerParallelShardsDepth
snsNotificationArn
skipMetaDataIndexing
lastIndexed
}
53 changes: 53 additions & 0 deletions catalog/app/containers/Admin/BucketConfigs.generated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'
import * as Types from '../../model/graphql/types.generated'

import {
BucketConfigSelectionFragment,
BucketConfigSelectionFragmentDoc,
} from './BucketConfigSelection.generated'

export type containers_Admin_BucketConfigsQueryVariables = Types.Exact<{
[key: string]: never
}>

export type containers_Admin_BucketConfigsQuery = { readonly __typename: 'Query' } & {
readonly bucketConfigs: ReadonlyArray<
{ readonly __typename: 'BucketConfig' } & BucketConfigSelectionFragment
>
}

export const containers_Admin_BucketConfigsDocument = ({
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: { kind: 'Name', value: 'containers_Admin_BucketConfigs' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'bucketConfigs' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'FragmentSpread',
name: { kind: 'Name', value: 'BucketConfigSelection' },
},
],
},
},
],
},
},
...BucketConfigSelectionFragmentDoc.definitions,
],
} as unknown) as DocumentNode<
containers_Admin_BucketConfigsQuery,
containers_Admin_BucketConfigsQueryVariables
>

export { containers_Admin_BucketConfigsDocument as default }
5 changes: 5 additions & 0 deletions catalog/app/containers/Admin/BucketConfigs.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# import BucketConfigSelection from "./BucketConfigSelection.graphql"

query {
bucketConfigs { ...BucketConfigSelection }
}
Loading

0 comments on commit af354f4

Please sign in to comment.