From 556043c0d729243cd0a90f913d44f61b2a74fa2d Mon Sep 17 00:00:00 2001 From: Thibaud Date: Wed, 17 May 2023 17:56:02 +0200 Subject: [PATCH] :card_file_box: replace TagLabel with Subject in db --- .../Home/components/Searchbar/Searchbar.jsx | 4 +- e2e/client.test.js | 4 +- server/prisma/datamodel.graphql | 12 +- server/scripts/tmp_tag_resync/part1.js | 8 +- server/src/generated/prisma.graphql | 713 +++++++++--------- server/src/helpers/diffTags.js | 6 +- server/src/resolvers/question.js | 20 +- server/src/schema.graphql | 4 +- 8 files changed, 384 insertions(+), 387 deletions(-) diff --git a/client/src/scenes/Home/components/Searchbar/Searchbar.jsx b/client/src/scenes/Home/components/Searchbar/Searchbar.jsx index d01d5ca70..277bd8160 100644 --- a/client/src/scenes/Home/components/Searchbar/Searchbar.jsx +++ b/client/src/scenes/Home/components/Searchbar/Searchbar.jsx @@ -13,7 +13,7 @@ const Searchbar = ({ text, tags, loading, onTextChange, onTagsChange }) => { const intl = getIntl(Searchbar) const conf = useConfiguration() - const tagLabels = tags + const subjects = tags .map(tag => conf.tagCategories .reduce((acc, cat) => acc.concat(cat.labels), []) @@ -45,7 +45,7 @@ const Searchbar = ({ text, tags, loading, onTextChange, onTagsChange }) => { diff --git a/e2e/client.test.js b/e2e/client.test.js index 29982e301..35d95c91b 100644 --- a/e2e/client.test.js +++ b/e2e/client.test.js @@ -139,7 +139,7 @@ const upsertConfigMutation = async apiContext => { const tagsId = /* GraphQL */ ` query GetAllTags { - tagLabels { + subjects { id name } @@ -153,7 +153,7 @@ const tagsQuery = async apiContext => { } }) const jsonRes = await res.json() - const results = await jsonRes.data.tagLabels + const results = await jsonRes.data.subjects const tag = results[0] const tagEdit = results[1] return { tag, tagEdit } diff --git a/server/prisma/datamodel.graphql b/server/prisma/datamodel.graphql index 9bda86629..5fc33ce95 100644 --- a/server/prisma/datamodel.graphql +++ b/server/prisma/datamodel.graphql @@ -68,7 +68,7 @@ type Flag { type Tag { id: ID! @unique @id - label: TagLabel @relation(name: "TagsLabel", link: TABLE) + label: Subject @relation(name: "Tags", link: TABLE) node: ZNode! @relation(name: "NodeTags") user: User! @relation(name: "UserTags", link: TABLE) @@ -77,15 +77,15 @@ type Tag { updatedAt: DateTime! @updatedAt } -type TagLabel { +type Subject { id: ID! @unique @id name: String! - tags: [Tag!]! @relation(name: "TagsLabel", onDelete: CASCADE) + tags: [Tag!]! @relation(name: "Tags", onDelete: CASCADE) specialists: [User!]! @relation(name: "UserSpecialties", link: TABLE) order: Int! - category: TagCategory! @relation(name: "TagLabelsCategory", link: TABLE) + category: TagCategory! @relation(name: "SubjectsCategory", link: TABLE) createdAt: DateTime! @createdAt updatedAt: DateTime! @updatedAt @@ -95,7 +95,7 @@ type TagCategory { id: ID! @unique @id name: String! - labels: [TagLabel!]! @relation(name: "TagLabelsCategory", onDelete: CASCADE) + labels: [Subject!]! @relation(name: "SubjectsCategory", onDelete: CASCADE) order: Int! configuration: Configuration! @relation(name: "ConfigurationTags", link: TABLE) @@ -136,7 +136,7 @@ type User { flags: [Flag!]! @relation(name: "UserFlags") tags: [Tag!]! @relation(name: "UserTags") - specialties: [TagLabel!]! @relation(name: "UserSpecialties") + specialties: [Subject!]! @relation(name: "UserSpecialties") history: [HistoryAction!]! @relation(name: "UserHistoryActions") diff --git a/server/scripts/tmp_tag_resync/part1.js b/server/scripts/tmp_tag_resync/part1.js index e6ba71045..6513a2a98 100644 --- a/server/scripts/tmp_tag_resync/part1.js +++ b/server/scripts/tmp_tag_resync/part1.js @@ -50,7 +50,7 @@ const resync = async (name, stage) => { ) ) - const tagLabels = tagsCategories.reduce((acc, cat) => acc.concat(cat.labels), []) + const subjects = tagsCategories.reduce((acc, cat) => acc.concat(cat.labels), []) const tags = await prisma.query.tags( null, @@ -64,8 +64,8 @@ const resync = async (name, stage) => { return Promise.all( tags.map(tag => { - const tagLabel = tagLabels.find(label => label.name === tag.label) - if (!tagLabel) { + const subject = subjects.find(label => label.name === tag.label) + if (!subject) { console.log(`Unknown tag "${tag.label}" on "${tag.id}"`) return } @@ -73,7 +73,7 @@ const resync = async (name, stage) => { where: { id: tag.id }, data: { // label: null, // I'll manually remove label. This is a security in case something goes wrong - tagLabel: { connect: { id: tagLabel.id } } + subject: { connect: { id: subject.id } } } }) }) diff --git a/server/src/generated/prisma.graphql b/server/src/generated/prisma.graphql index bb6d875f8..04e384400 100644 --- a/server/src/generated/prisma.graphql +++ b/server/src/generated/prisma.graphql @@ -22,15 +22,15 @@ type AggregateSource { count: Int! } -type AggregateTag { +type AggregateSubject { count: Int! } -type AggregateTagCategory { +type AggregateTag { count: Int! } -type AggregateTagLabel { +type AggregateTagCategory { count: Int! } @@ -1448,6 +1448,16 @@ type Mutation { ): Source! deleteSource(where: SourceWhereUniqueInput!): Source deleteManySources(where: SourceWhereInput): BatchPayload! + createSubject(data: SubjectCreateInput!): Subject! + updateSubject(data: SubjectUpdateInput!, where: SubjectWhereUniqueInput!): Subject + updateManySubjects(data: SubjectUpdateManyMutationInput!, where: SubjectWhereInput): BatchPayload! + upsertSubject( + where: SubjectWhereUniqueInput! + create: SubjectCreateInput! + update: SubjectUpdateInput! + ): Subject! + deleteSubject(where: SubjectWhereUniqueInput!): Subject + deleteManySubjects(where: SubjectWhereInput): BatchPayload! createTag(data: TagCreateInput!): Tag! updateTag(data: TagUpdateInput!, where: TagWhereUniqueInput!): Tag upsertTag(where: TagWhereUniqueInput!, create: TagCreateInput!, update: TagUpdateInput!): Tag! @@ -1466,19 +1476,6 @@ type Mutation { ): TagCategory! deleteTagCategory(where: TagCategoryWhereUniqueInput!): TagCategory deleteManyTagCategories(where: TagCategoryWhereInput): BatchPayload! - createTagLabel(data: TagLabelCreateInput!): TagLabel! - updateTagLabel(data: TagLabelUpdateInput!, where: TagLabelWhereUniqueInput!): TagLabel - updateManyTagLabels( - data: TagLabelUpdateManyMutationInput! - where: TagLabelWhereInput - ): BatchPayload! - upsertTagLabel( - where: TagLabelWhereUniqueInput! - create: TagLabelCreateInput! - update: TagLabelUpdateInput! - ): TagLabel! - deleteTagLabel(where: TagLabelWhereUniqueInput!): TagLabel - deleteManyTagLabels(where: TagLabelWhereInput): BatchPayload! createUser(data: UserCreateInput!): User! updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User updateManyUsers(data: UserUpdateManyMutationInput!, where: UserWhereInput): BatchPayload! @@ -1633,6 +1630,25 @@ type Query { first: Int last: Int ): SourceConnection! + subject(where: SubjectWhereUniqueInput!): Subject + subjects( + where: SubjectWhereInput + orderBy: SubjectOrderByInput + skip: Int + after: String + before: String + first: Int + last: Int + ): [Subject]! + subjectsConnection( + where: SubjectWhereInput + orderBy: SubjectOrderByInput + skip: Int + after: String + before: String + first: Int + last: Int + ): SubjectConnection! tag(where: TagWhereUniqueInput!): Tag tags( where: TagWhereInput @@ -1671,25 +1687,6 @@ type Query { first: Int last: Int ): TagCategoryConnection! - tagLabel(where: TagLabelWhereUniqueInput!): TagLabel - tagLabels( - where: TagLabelWhereInput - orderBy: TagLabelOrderByInput - skip: Int - after: String - before: String - first: Int - last: Int - ): [TagLabel]! - tagLabelsConnection( - where: TagLabelWhereInput - orderBy: TagLabelOrderByInput - skip: Int - after: String - before: String - first: Int - last: Int - ): TagLabelConnection! user(where: UserWhereUniqueInput!): User users( where: UserWhereInput @@ -2315,91 +2312,93 @@ input SourceWhereUniqueInput { id: ID } -type Subscription { - answer(where: AnswerSubscriptionWhereInput): AnswerSubscriptionPayload - configuration(where: ConfigurationSubscriptionWhereInput): ConfigurationSubscriptionPayload - flag(where: FlagSubscriptionWhereInput): FlagSubscriptionPayload - historyAction(where: HistoryActionSubscriptionWhereInput): HistoryActionSubscriptionPayload - question(where: QuestionSubscriptionWhereInput): QuestionSubscriptionPayload - source(where: SourceSubscriptionWhereInput): SourceSubscriptionPayload - tag(where: TagSubscriptionWhereInput): TagSubscriptionPayload - tagCategory(where: TagCategorySubscriptionWhereInput): TagCategorySubscriptionPayload - tagLabel(where: TagLabelSubscriptionWhereInput): TagLabelSubscriptionPayload - user(where: UserSubscriptionWhereInput): UserSubscriptionPayload - zNode(where: ZNodeSubscriptionWhereInput): ZNodeSubscriptionPayload -} - -type Tag { - id: ID! - label: TagLabel - node: ZNode! - user: User! - createdAt: DateTime! - updatedAt: DateTime! -} - -type TagCategory { +type Subject { id: ID! name: String! - labels( - where: TagLabelWhereInput - orderBy: TagLabelOrderByInput + tags( + where: TagWhereInput + orderBy: TagOrderByInput skip: Int after: String before: String first: Int last: Int - ): [TagLabel!] + ): [Tag!] + specialists( + where: UserWhereInput + orderBy: UserOrderByInput + skip: Int + after: String + before: String + first: Int + last: Int + ): [User!] order: Int! - configuration: Configuration! + category: TagCategory! createdAt: DateTime! updatedAt: DateTime! } -type TagCategoryConnection { +type SubjectConnection { pageInfo: PageInfo! - edges: [TagCategoryEdge]! - aggregate: AggregateTagCategory! + edges: [SubjectEdge]! + aggregate: AggregateSubject! } -input TagCategoryCreateInput { +input SubjectCreateInput { id: ID name: String! - labels: TagLabelCreateManyWithoutCategoryInput + tags: TagCreateManyWithoutLabelInput + specialists: UserCreateManyWithoutSpecialtiesInput order: Int! - configuration: ConfigurationCreateOneWithoutTagCategoriesInput! + category: TagCategoryCreateOneWithoutLabelsInput! } -input TagCategoryCreateManyWithoutConfigurationInput { - create: [TagCategoryCreateWithoutConfigurationInput!] - connect: [TagCategoryWhereUniqueInput!] +input SubjectCreateManyWithoutCategoryInput { + create: [SubjectCreateWithoutCategoryInput!] + connect: [SubjectWhereUniqueInput!] } -input TagCategoryCreateOneWithoutLabelsInput { - create: TagCategoryCreateWithoutLabelsInput - connect: TagCategoryWhereUniqueInput +input SubjectCreateManyWithoutSpecialistsInput { + create: [SubjectCreateWithoutSpecialistsInput!] + connect: [SubjectWhereUniqueInput!] } -input TagCategoryCreateWithoutConfigurationInput { +input SubjectCreateOneWithoutTagsInput { + create: SubjectCreateWithoutTagsInput + connect: SubjectWhereUniqueInput +} + +input SubjectCreateWithoutCategoryInput { id: ID name: String! - labels: TagLabelCreateManyWithoutCategoryInput + tags: TagCreateManyWithoutLabelInput + specialists: UserCreateManyWithoutSpecialtiesInput order: Int! } -input TagCategoryCreateWithoutLabelsInput { +input SubjectCreateWithoutSpecialistsInput { id: ID name: String! + tags: TagCreateManyWithoutLabelInput order: Int! - configuration: ConfigurationCreateOneWithoutTagCategoriesInput! + category: TagCategoryCreateOneWithoutLabelsInput! } -type TagCategoryEdge { - node: TagCategory! +input SubjectCreateWithoutTagsInput { + id: ID + name: String! + specialists: UserCreateManyWithoutSpecialtiesInput + order: Int! + category: TagCategoryCreateOneWithoutLabelsInput! +} + +type SubjectEdge { + node: Subject! cursor: String! } -enum TagCategoryOrderByInput { +enum SubjectOrderByInput { id_ASC id_DESC name_ASC @@ -2412,7 +2411,7 @@ enum TagCategoryOrderByInput { updatedAt_DESC } -type TagCategoryPreviousValues { +type SubjectPreviousValues { id: ID! name: String! order: Int! @@ -2420,7 +2419,7 @@ type TagCategoryPreviousValues { updatedAt: DateTime! } -input TagCategoryScalarWhereInput { +input SubjectScalarWhereInput { id: ID id_not: ID id_in: [ID!] @@ -2473,99 +2472,134 @@ input TagCategoryScalarWhereInput { updatedAt_lte: DateTime updatedAt_gt: DateTime updatedAt_gte: DateTime - AND: [TagCategoryScalarWhereInput!] - OR: [TagCategoryScalarWhereInput!] - NOT: [TagCategoryScalarWhereInput!] + AND: [SubjectScalarWhereInput!] + OR: [SubjectScalarWhereInput!] + NOT: [SubjectScalarWhereInput!] } -type TagCategorySubscriptionPayload { +type SubjectSubscriptionPayload { mutation: MutationType! - node: TagCategory + node: Subject updatedFields: [String!] - previousValues: TagCategoryPreviousValues + previousValues: SubjectPreviousValues } -input TagCategorySubscriptionWhereInput { +input SubjectSubscriptionWhereInput { mutation_in: [MutationType!] updatedFields_contains: String updatedFields_contains_every: [String!] updatedFields_contains_some: [String!] - node: TagCategoryWhereInput - AND: [TagCategorySubscriptionWhereInput!] - OR: [TagCategorySubscriptionWhereInput!] - NOT: [TagCategorySubscriptionWhereInput!] + node: SubjectWhereInput + AND: [SubjectSubscriptionWhereInput!] + OR: [SubjectSubscriptionWhereInput!] + NOT: [SubjectSubscriptionWhereInput!] } -input TagCategoryUpdateInput { +input SubjectUpdateInput { name: String - labels: TagLabelUpdateManyWithoutCategoryInput + tags: TagUpdateManyWithoutLabelInput + specialists: UserUpdateManyWithoutSpecialtiesInput order: Int - configuration: ConfigurationUpdateOneRequiredWithoutTagCategoriesInput + category: TagCategoryUpdateOneRequiredWithoutLabelsInput } -input TagCategoryUpdateManyDataInput { +input SubjectUpdateManyDataInput { name: String order: Int } -input TagCategoryUpdateManyMutationInput { +input SubjectUpdateManyMutationInput { name: String order: Int } -input TagCategoryUpdateManyWithoutConfigurationInput { - create: [TagCategoryCreateWithoutConfigurationInput!] - delete: [TagCategoryWhereUniqueInput!] - connect: [TagCategoryWhereUniqueInput!] - set: [TagCategoryWhereUniqueInput!] - disconnect: [TagCategoryWhereUniqueInput!] - update: [TagCategoryUpdateWithWhereUniqueWithoutConfigurationInput!] - upsert: [TagCategoryUpsertWithWhereUniqueWithoutConfigurationInput!] - deleteMany: [TagCategoryScalarWhereInput!] - updateMany: [TagCategoryUpdateManyWithWhereNestedInput!] +input SubjectUpdateManyWithoutCategoryInput { + create: [SubjectCreateWithoutCategoryInput!] + delete: [SubjectWhereUniqueInput!] + connect: [SubjectWhereUniqueInput!] + set: [SubjectWhereUniqueInput!] + disconnect: [SubjectWhereUniqueInput!] + update: [SubjectUpdateWithWhereUniqueWithoutCategoryInput!] + upsert: [SubjectUpsertWithWhereUniqueWithoutCategoryInput!] + deleteMany: [SubjectScalarWhereInput!] + updateMany: [SubjectUpdateManyWithWhereNestedInput!] } -input TagCategoryUpdateManyWithWhereNestedInput { - where: TagCategoryScalarWhereInput! - data: TagCategoryUpdateManyDataInput! +input SubjectUpdateManyWithoutSpecialistsInput { + create: [SubjectCreateWithoutSpecialistsInput!] + delete: [SubjectWhereUniqueInput!] + connect: [SubjectWhereUniqueInput!] + set: [SubjectWhereUniqueInput!] + disconnect: [SubjectWhereUniqueInput!] + update: [SubjectUpdateWithWhereUniqueWithoutSpecialistsInput!] + upsert: [SubjectUpsertWithWhereUniqueWithoutSpecialistsInput!] + deleteMany: [SubjectScalarWhereInput!] + updateMany: [SubjectUpdateManyWithWhereNestedInput!] } -input TagCategoryUpdateOneRequiredWithoutLabelsInput { - create: TagCategoryCreateWithoutLabelsInput - update: TagCategoryUpdateWithoutLabelsDataInput - upsert: TagCategoryUpsertWithoutLabelsInput - connect: TagCategoryWhereUniqueInput +input SubjectUpdateManyWithWhereNestedInput { + where: SubjectScalarWhereInput! + data: SubjectUpdateManyDataInput! } -input TagCategoryUpdateWithoutConfigurationDataInput { +input SubjectUpdateOneWithoutTagsInput { + create: SubjectCreateWithoutTagsInput + update: SubjectUpdateWithoutTagsDataInput + upsert: SubjectUpsertWithoutTagsInput + delete: Boolean + disconnect: Boolean + connect: SubjectWhereUniqueInput +} + +input SubjectUpdateWithoutCategoryDataInput { name: String - labels: TagLabelUpdateManyWithoutCategoryInput + tags: TagUpdateManyWithoutLabelInput + specialists: UserUpdateManyWithoutSpecialtiesInput order: Int } -input TagCategoryUpdateWithoutLabelsDataInput { +input SubjectUpdateWithoutSpecialistsDataInput { name: String + tags: TagUpdateManyWithoutLabelInput order: Int - configuration: ConfigurationUpdateOneRequiredWithoutTagCategoriesInput + category: TagCategoryUpdateOneRequiredWithoutLabelsInput } -input TagCategoryUpdateWithWhereUniqueWithoutConfigurationInput { - where: TagCategoryWhereUniqueInput! - data: TagCategoryUpdateWithoutConfigurationDataInput! +input SubjectUpdateWithoutTagsDataInput { + name: String + specialists: UserUpdateManyWithoutSpecialtiesInput + order: Int + category: TagCategoryUpdateOneRequiredWithoutLabelsInput } -input TagCategoryUpsertWithoutLabelsInput { - update: TagCategoryUpdateWithoutLabelsDataInput! - create: TagCategoryCreateWithoutLabelsInput! +input SubjectUpdateWithWhereUniqueWithoutCategoryInput { + where: SubjectWhereUniqueInput! + data: SubjectUpdateWithoutCategoryDataInput! } -input TagCategoryUpsertWithWhereUniqueWithoutConfigurationInput { - where: TagCategoryWhereUniqueInput! - update: TagCategoryUpdateWithoutConfigurationDataInput! - create: TagCategoryCreateWithoutConfigurationInput! +input SubjectUpdateWithWhereUniqueWithoutSpecialistsInput { + where: SubjectWhereUniqueInput! + data: SubjectUpdateWithoutSpecialistsDataInput! } -input TagCategoryWhereInput { +input SubjectUpsertWithoutTagsInput { + update: SubjectUpdateWithoutTagsDataInput! + create: SubjectCreateWithoutTagsInput! +} + +input SubjectUpsertWithWhereUniqueWithoutCategoryInput { + where: SubjectWhereUniqueInput! + update: SubjectUpdateWithoutCategoryDataInput! + create: SubjectCreateWithoutCategoryInput! +} + +input SubjectUpsertWithWhereUniqueWithoutSpecialistsInput { + where: SubjectWhereUniqueInput! + update: SubjectUpdateWithoutSpecialistsDataInput! + create: SubjectCreateWithoutSpecialistsInput! +} + +input SubjectWhereInput { id: ID id_not: ID id_in: [ID!] @@ -2594,9 +2628,12 @@ input TagCategoryWhereInput { name_not_starts_with: String name_ends_with: String name_not_ends_with: String - labels_every: TagLabelWhereInput - labels_some: TagLabelWhereInput - labels_none: TagLabelWhereInput + tags_every: TagWhereInput + tags_some: TagWhereInput + tags_none: TagWhereInput + specialists_every: UserWhereInput + specialists_some: UserWhereInput + specialists_none: UserWhereInput order: Int order_not: Int order_in: [Int!] @@ -2605,7 +2642,7 @@ input TagCategoryWhereInput { order_lte: Int order_gt: Int order_gte: Int - configuration: ConfigurationWhereInput + category: TagCategoryWhereInput createdAt: DateTime createdAt_not: DateTime createdAt_in: [DateTime!] @@ -2622,153 +2659,100 @@ input TagCategoryWhereInput { updatedAt_lte: DateTime updatedAt_gt: DateTime updatedAt_gte: DateTime - AND: [TagCategoryWhereInput!] - OR: [TagCategoryWhereInput!] - NOT: [TagCategoryWhereInput!] -} - -input TagCategoryWhereUniqueInput { - id: ID -} - -type TagConnection { - pageInfo: PageInfo! - edges: [TagEdge]! - aggregate: AggregateTag! + AND: [SubjectWhereInput!] + OR: [SubjectWhereInput!] + NOT: [SubjectWhereInput!] } -input TagCreateInput { +input SubjectWhereUniqueInput { id: ID - label: TagLabelCreateOneWithoutTagsInput - node: ZNodeCreateOneWithoutTagsInput! - user: UserCreateOneWithoutTagsInput! -} - -input TagCreateManyWithoutLabelInput { - create: [TagCreateWithoutLabelInput!] - connect: [TagWhereUniqueInput!] -} - -input TagCreateManyWithoutNodeInput { - create: [TagCreateWithoutNodeInput!] - connect: [TagWhereUniqueInput!] } -input TagCreateManyWithoutUserInput { - create: [TagCreateWithoutUserInput!] - connect: [TagWhereUniqueInput!] -} - -input TagCreateWithoutLabelInput { - id: ID - node: ZNodeCreateOneWithoutTagsInput! - user: UserCreateOneWithoutTagsInput! -} - -input TagCreateWithoutNodeInput { - id: ID - label: TagLabelCreateOneWithoutTagsInput - user: UserCreateOneWithoutTagsInput! -} - -input TagCreateWithoutUserInput { - id: ID - label: TagLabelCreateOneWithoutTagsInput - node: ZNodeCreateOneWithoutTagsInput! +type Subscription { + answer(where: AnswerSubscriptionWhereInput): AnswerSubscriptionPayload + configuration(where: ConfigurationSubscriptionWhereInput): ConfigurationSubscriptionPayload + flag(where: FlagSubscriptionWhereInput): FlagSubscriptionPayload + historyAction(where: HistoryActionSubscriptionWhereInput): HistoryActionSubscriptionPayload + question(where: QuestionSubscriptionWhereInput): QuestionSubscriptionPayload + source(where: SourceSubscriptionWhereInput): SourceSubscriptionPayload + subject(where: SubjectSubscriptionWhereInput): SubjectSubscriptionPayload + tag(where: TagSubscriptionWhereInput): TagSubscriptionPayload + tagCategory(where: TagCategorySubscriptionWhereInput): TagCategorySubscriptionPayload + user(where: UserSubscriptionWhereInput): UserSubscriptionPayload + zNode(where: ZNodeSubscriptionWhereInput): ZNodeSubscriptionPayload } -type TagEdge { - node: Tag! - cursor: String! +type Tag { + id: ID! + label: Subject + node: ZNode! + user: User! + createdAt: DateTime! + updatedAt: DateTime! } -type TagLabel { +type TagCategory { id: ID! name: String! - tags( - where: TagWhereInput - orderBy: TagOrderByInput - skip: Int - after: String - before: String - first: Int - last: Int - ): [Tag!] - specialists( - where: UserWhereInput - orderBy: UserOrderByInput + labels( + where: SubjectWhereInput + orderBy: SubjectOrderByInput skip: Int after: String before: String first: Int last: Int - ): [User!] + ): [Subject!] order: Int! - category: TagCategory! + configuration: Configuration! createdAt: DateTime! updatedAt: DateTime! } -type TagLabelConnection { +type TagCategoryConnection { pageInfo: PageInfo! - edges: [TagLabelEdge]! - aggregate: AggregateTagLabel! + edges: [TagCategoryEdge]! + aggregate: AggregateTagCategory! } -input TagLabelCreateInput { +input TagCategoryCreateInput { id: ID name: String! - tags: TagCreateManyWithoutLabelInput - specialists: UserCreateManyWithoutSpecialtiesInput + labels: SubjectCreateManyWithoutCategoryInput order: Int! - category: TagCategoryCreateOneWithoutLabelsInput! -} - -input TagLabelCreateManyWithoutCategoryInput { - create: [TagLabelCreateWithoutCategoryInput!] - connect: [TagLabelWhereUniqueInput!] -} - -input TagLabelCreateManyWithoutSpecialistsInput { - create: [TagLabelCreateWithoutSpecialistsInput!] - connect: [TagLabelWhereUniqueInput!] + configuration: ConfigurationCreateOneWithoutTagCategoriesInput! } -input TagLabelCreateOneWithoutTagsInput { - create: TagLabelCreateWithoutTagsInput - connect: TagLabelWhereUniqueInput +input TagCategoryCreateManyWithoutConfigurationInput { + create: [TagCategoryCreateWithoutConfigurationInput!] + connect: [TagCategoryWhereUniqueInput!] } -input TagLabelCreateWithoutCategoryInput { - id: ID - name: String! - tags: TagCreateManyWithoutLabelInput - specialists: UserCreateManyWithoutSpecialtiesInput - order: Int! +input TagCategoryCreateOneWithoutLabelsInput { + create: TagCategoryCreateWithoutLabelsInput + connect: TagCategoryWhereUniqueInput } -input TagLabelCreateWithoutSpecialistsInput { +input TagCategoryCreateWithoutConfigurationInput { id: ID name: String! - tags: TagCreateManyWithoutLabelInput + labels: SubjectCreateManyWithoutCategoryInput order: Int! - category: TagCategoryCreateOneWithoutLabelsInput! } -input TagLabelCreateWithoutTagsInput { +input TagCategoryCreateWithoutLabelsInput { id: ID name: String! - specialists: UserCreateManyWithoutSpecialtiesInput order: Int! - category: TagCategoryCreateOneWithoutLabelsInput! + configuration: ConfigurationCreateOneWithoutTagCategoriesInput! } -type TagLabelEdge { - node: TagLabel! +type TagCategoryEdge { + node: TagCategory! cursor: String! } -enum TagLabelOrderByInput { +enum TagCategoryOrderByInput { id_ASC id_DESC name_ASC @@ -2781,7 +2765,7 @@ enum TagLabelOrderByInput { updatedAt_DESC } -type TagLabelPreviousValues { +type TagCategoryPreviousValues { id: ID! name: String! order: Int! @@ -2789,7 +2773,7 @@ type TagLabelPreviousValues { updatedAt: DateTime! } -input TagLabelScalarWhereInput { +input TagCategoryScalarWhereInput { id: ID id_not: ID id_in: [ID!] @@ -2842,134 +2826,99 @@ input TagLabelScalarWhereInput { updatedAt_lte: DateTime updatedAt_gt: DateTime updatedAt_gte: DateTime - AND: [TagLabelScalarWhereInput!] - OR: [TagLabelScalarWhereInput!] - NOT: [TagLabelScalarWhereInput!] + AND: [TagCategoryScalarWhereInput!] + OR: [TagCategoryScalarWhereInput!] + NOT: [TagCategoryScalarWhereInput!] } -type TagLabelSubscriptionPayload { +type TagCategorySubscriptionPayload { mutation: MutationType! - node: TagLabel + node: TagCategory updatedFields: [String!] - previousValues: TagLabelPreviousValues + previousValues: TagCategoryPreviousValues } -input TagLabelSubscriptionWhereInput { +input TagCategorySubscriptionWhereInput { mutation_in: [MutationType!] updatedFields_contains: String updatedFields_contains_every: [String!] updatedFields_contains_some: [String!] - node: TagLabelWhereInput - AND: [TagLabelSubscriptionWhereInput!] - OR: [TagLabelSubscriptionWhereInput!] - NOT: [TagLabelSubscriptionWhereInput!] + node: TagCategoryWhereInput + AND: [TagCategorySubscriptionWhereInput!] + OR: [TagCategorySubscriptionWhereInput!] + NOT: [TagCategorySubscriptionWhereInput!] } -input TagLabelUpdateInput { +input TagCategoryUpdateInput { name: String - tags: TagUpdateManyWithoutLabelInput - specialists: UserUpdateManyWithoutSpecialtiesInput + labels: SubjectUpdateManyWithoutCategoryInput order: Int - category: TagCategoryUpdateOneRequiredWithoutLabelsInput + configuration: ConfigurationUpdateOneRequiredWithoutTagCategoriesInput } -input TagLabelUpdateManyDataInput { +input TagCategoryUpdateManyDataInput { name: String order: Int } -input TagLabelUpdateManyMutationInput { +input TagCategoryUpdateManyMutationInput { name: String order: Int } -input TagLabelUpdateManyWithoutCategoryInput { - create: [TagLabelCreateWithoutCategoryInput!] - delete: [TagLabelWhereUniqueInput!] - connect: [TagLabelWhereUniqueInput!] - set: [TagLabelWhereUniqueInput!] - disconnect: [TagLabelWhereUniqueInput!] - update: [TagLabelUpdateWithWhereUniqueWithoutCategoryInput!] - upsert: [TagLabelUpsertWithWhereUniqueWithoutCategoryInput!] - deleteMany: [TagLabelScalarWhereInput!] - updateMany: [TagLabelUpdateManyWithWhereNestedInput!] -} - -input TagLabelUpdateManyWithoutSpecialistsInput { - create: [TagLabelCreateWithoutSpecialistsInput!] - delete: [TagLabelWhereUniqueInput!] - connect: [TagLabelWhereUniqueInput!] - set: [TagLabelWhereUniqueInput!] - disconnect: [TagLabelWhereUniqueInput!] - update: [TagLabelUpdateWithWhereUniqueWithoutSpecialistsInput!] - upsert: [TagLabelUpsertWithWhereUniqueWithoutSpecialistsInput!] - deleteMany: [TagLabelScalarWhereInput!] - updateMany: [TagLabelUpdateManyWithWhereNestedInput!] -} - -input TagLabelUpdateManyWithWhereNestedInput { - where: TagLabelScalarWhereInput! - data: TagLabelUpdateManyDataInput! +input TagCategoryUpdateManyWithoutConfigurationInput { + create: [TagCategoryCreateWithoutConfigurationInput!] + delete: [TagCategoryWhereUniqueInput!] + connect: [TagCategoryWhereUniqueInput!] + set: [TagCategoryWhereUniqueInput!] + disconnect: [TagCategoryWhereUniqueInput!] + update: [TagCategoryUpdateWithWhereUniqueWithoutConfigurationInput!] + upsert: [TagCategoryUpsertWithWhereUniqueWithoutConfigurationInput!] + deleteMany: [TagCategoryScalarWhereInput!] + updateMany: [TagCategoryUpdateManyWithWhereNestedInput!] } -input TagLabelUpdateOneWithoutTagsInput { - create: TagLabelCreateWithoutTagsInput - update: TagLabelUpdateWithoutTagsDataInput - upsert: TagLabelUpsertWithoutTagsInput - delete: Boolean - disconnect: Boolean - connect: TagLabelWhereUniqueInput +input TagCategoryUpdateManyWithWhereNestedInput { + where: TagCategoryScalarWhereInput! + data: TagCategoryUpdateManyDataInput! } -input TagLabelUpdateWithoutCategoryDataInput { - name: String - tags: TagUpdateManyWithoutLabelInput - specialists: UserUpdateManyWithoutSpecialtiesInput - order: Int +input TagCategoryUpdateOneRequiredWithoutLabelsInput { + create: TagCategoryCreateWithoutLabelsInput + update: TagCategoryUpdateWithoutLabelsDataInput + upsert: TagCategoryUpsertWithoutLabelsInput + connect: TagCategoryWhereUniqueInput } -input TagLabelUpdateWithoutSpecialistsDataInput { +input TagCategoryUpdateWithoutConfigurationDataInput { name: String - tags: TagUpdateManyWithoutLabelInput + labels: SubjectUpdateManyWithoutCategoryInput order: Int - category: TagCategoryUpdateOneRequiredWithoutLabelsInput } -input TagLabelUpdateWithoutTagsDataInput { +input TagCategoryUpdateWithoutLabelsDataInput { name: String - specialists: UserUpdateManyWithoutSpecialtiesInput order: Int - category: TagCategoryUpdateOneRequiredWithoutLabelsInput -} - -input TagLabelUpdateWithWhereUniqueWithoutCategoryInput { - where: TagLabelWhereUniqueInput! - data: TagLabelUpdateWithoutCategoryDataInput! -} - -input TagLabelUpdateWithWhereUniqueWithoutSpecialistsInput { - where: TagLabelWhereUniqueInput! - data: TagLabelUpdateWithoutSpecialistsDataInput! + configuration: ConfigurationUpdateOneRequiredWithoutTagCategoriesInput } -input TagLabelUpsertWithoutTagsInput { - update: TagLabelUpdateWithoutTagsDataInput! - create: TagLabelCreateWithoutTagsInput! +input TagCategoryUpdateWithWhereUniqueWithoutConfigurationInput { + where: TagCategoryWhereUniqueInput! + data: TagCategoryUpdateWithoutConfigurationDataInput! } -input TagLabelUpsertWithWhereUniqueWithoutCategoryInput { - where: TagLabelWhereUniqueInput! - update: TagLabelUpdateWithoutCategoryDataInput! - create: TagLabelCreateWithoutCategoryInput! +input TagCategoryUpsertWithoutLabelsInput { + update: TagCategoryUpdateWithoutLabelsDataInput! + create: TagCategoryCreateWithoutLabelsInput! } -input TagLabelUpsertWithWhereUniqueWithoutSpecialistsInput { - where: TagLabelWhereUniqueInput! - update: TagLabelUpdateWithoutSpecialistsDataInput! - create: TagLabelCreateWithoutSpecialistsInput! +input TagCategoryUpsertWithWhereUniqueWithoutConfigurationInput { + where: TagCategoryWhereUniqueInput! + update: TagCategoryUpdateWithoutConfigurationDataInput! + create: TagCategoryCreateWithoutConfigurationInput! } -input TagLabelWhereInput { +input TagCategoryWhereInput { id: ID id_not: ID id_in: [ID!] @@ -2998,12 +2947,9 @@ input TagLabelWhereInput { name_not_starts_with: String name_ends_with: String name_not_ends_with: String - tags_every: TagWhereInput - tags_some: TagWhereInput - tags_none: TagWhereInput - specialists_every: UserWhereInput - specialists_some: UserWhereInput - specialists_none: UserWhereInput + labels_every: SubjectWhereInput + labels_some: SubjectWhereInput + labels_none: SubjectWhereInput order: Int order_not: Int order_in: [Int!] @@ -3012,7 +2958,7 @@ input TagLabelWhereInput { order_lte: Int order_gt: Int order_gte: Int - category: TagCategoryWhereInput + configuration: ConfigurationWhereInput createdAt: DateTime createdAt_not: DateTime createdAt_in: [DateTime!] @@ -3029,13 +2975,64 @@ input TagLabelWhereInput { updatedAt_lte: DateTime updatedAt_gt: DateTime updatedAt_gte: DateTime - AND: [TagLabelWhereInput!] - OR: [TagLabelWhereInput!] - NOT: [TagLabelWhereInput!] + AND: [TagCategoryWhereInput!] + OR: [TagCategoryWhereInput!] + NOT: [TagCategoryWhereInput!] +} + +input TagCategoryWhereUniqueInput { + id: ID +} + +type TagConnection { + pageInfo: PageInfo! + edges: [TagEdge]! + aggregate: AggregateTag! +} + +input TagCreateInput { + id: ID + label: SubjectCreateOneWithoutTagsInput + node: ZNodeCreateOneWithoutTagsInput! + user: UserCreateOneWithoutTagsInput! +} + +input TagCreateManyWithoutLabelInput { + create: [TagCreateWithoutLabelInput!] + connect: [TagWhereUniqueInput!] +} + +input TagCreateManyWithoutNodeInput { + create: [TagCreateWithoutNodeInput!] + connect: [TagWhereUniqueInput!] +} + +input TagCreateManyWithoutUserInput { + create: [TagCreateWithoutUserInput!] + connect: [TagWhereUniqueInput!] +} + +input TagCreateWithoutLabelInput { + id: ID + node: ZNodeCreateOneWithoutTagsInput! + user: UserCreateOneWithoutTagsInput! } -input TagLabelWhereUniqueInput { +input TagCreateWithoutNodeInput { + id: ID + label: SubjectCreateOneWithoutTagsInput + user: UserCreateOneWithoutTagsInput! +} + +input TagCreateWithoutUserInput { id: ID + label: SubjectCreateOneWithoutTagsInput + node: ZNodeCreateOneWithoutTagsInput! +} + +type TagEdge { + node: Tag! + cursor: String! } enum TagOrderByInput { @@ -3108,7 +3105,7 @@ input TagSubscriptionWhereInput { } input TagUpdateInput { - label: TagLabelUpdateOneWithoutTagsInput + label: SubjectUpdateOneWithoutTagsInput node: ZNodeUpdateOneRequiredWithoutTagsInput user: UserUpdateOneRequiredWithoutTagsInput } @@ -3152,12 +3149,12 @@ input TagUpdateWithoutLabelDataInput { } input TagUpdateWithoutNodeDataInput { - label: TagLabelUpdateOneWithoutTagsInput + label: SubjectUpdateOneWithoutTagsInput user: UserUpdateOneRequiredWithoutTagsInput } input TagUpdateWithoutUserDataInput { - label: TagLabelUpdateOneWithoutTagsInput + label: SubjectUpdateOneWithoutTagsInput node: ZNodeUpdateOneRequiredWithoutTagsInput } @@ -3209,7 +3206,7 @@ input TagWhereInput { id_not_starts_with: ID id_ends_with: ID id_not_ends_with: ID - label: TagLabelWhereInput + label: SubjectWhereInput node: ZNodeWhereInput user: UserWhereInput createdAt: DateTime @@ -3283,14 +3280,14 @@ type User { last: Int ): [Tag!] specialties( - where: TagLabelWhereInput - orderBy: TagLabelOrderByInput + where: SubjectWhereInput + orderBy: SubjectOrderByInput skip: Int after: String before: String first: Int last: Int - ): [TagLabel!] + ): [Subject!] history( where: HistoryActionWhereInput orderBy: HistoryActionOrderByInput @@ -3323,7 +3320,7 @@ input UserCreateInput { answers: AnswerCreateManyWithoutUserInput flags: FlagCreateManyWithoutUserInput tags: TagCreateManyWithoutUserInput - specialties: TagLabelCreateManyWithoutSpecialistsInput + specialties: SubjectCreateManyWithoutSpecialistsInput history: HistoryActionCreateManyWithoutUserInput } @@ -3369,7 +3366,7 @@ input UserCreateWithoutAnswersInput { questions: QuestionCreateManyWithoutUserInput flags: FlagCreateManyWithoutUserInput tags: TagCreateManyWithoutUserInput - specialties: TagLabelCreateManyWithoutSpecialistsInput + specialties: SubjectCreateManyWithoutSpecialistsInput history: HistoryActionCreateManyWithoutUserInput } @@ -3385,7 +3382,7 @@ input UserCreateWithoutFlagsInput { questions: QuestionCreateManyWithoutUserInput answers: AnswerCreateManyWithoutUserInput tags: TagCreateManyWithoutUserInput - specialties: TagLabelCreateManyWithoutSpecialistsInput + specialties: SubjectCreateManyWithoutSpecialistsInput history: HistoryActionCreateManyWithoutUserInput } @@ -3402,7 +3399,7 @@ input UserCreateWithoutHistoryInput { answers: AnswerCreateManyWithoutUserInput flags: FlagCreateManyWithoutUserInput tags: TagCreateManyWithoutUserInput - specialties: TagLabelCreateManyWithoutSpecialistsInput + specialties: SubjectCreateManyWithoutSpecialistsInput } input UserCreateWithoutQuestionsInput { @@ -3417,7 +3414,7 @@ input UserCreateWithoutQuestionsInput { answers: AnswerCreateManyWithoutUserInput flags: FlagCreateManyWithoutUserInput tags: TagCreateManyWithoutUserInput - specialties: TagLabelCreateManyWithoutSpecialistsInput + specialties: SubjectCreateManyWithoutSpecialistsInput history: HistoryActionCreateManyWithoutUserInput } @@ -3449,7 +3446,7 @@ input UserCreateWithoutTagsInput { questions: QuestionCreateManyWithoutUserInput answers: AnswerCreateManyWithoutUserInput flags: FlagCreateManyWithoutUserInput - specialties: TagLabelCreateManyWithoutSpecialistsInput + specialties: SubjectCreateManyWithoutSpecialistsInput history: HistoryActionCreateManyWithoutUserInput } @@ -3646,7 +3643,7 @@ input UserUpdateInput { answers: AnswerUpdateManyWithoutUserInput flags: FlagUpdateManyWithoutUserInput tags: TagUpdateManyWithoutUserInput - specialties: TagLabelUpdateManyWithoutSpecialistsInput + specialties: SubjectUpdateManyWithoutSpecialistsInput history: HistoryActionUpdateManyWithoutUserInput } @@ -3733,7 +3730,7 @@ input UserUpdateWithoutAnswersDataInput { questions: QuestionUpdateManyWithoutUserInput flags: FlagUpdateManyWithoutUserInput tags: TagUpdateManyWithoutUserInput - specialties: TagLabelUpdateManyWithoutSpecialistsInput + specialties: SubjectUpdateManyWithoutSpecialistsInput history: HistoryActionUpdateManyWithoutUserInput } @@ -3748,7 +3745,7 @@ input UserUpdateWithoutFlagsDataInput { questions: QuestionUpdateManyWithoutUserInput answers: AnswerUpdateManyWithoutUserInput tags: TagUpdateManyWithoutUserInput - specialties: TagLabelUpdateManyWithoutSpecialistsInput + specialties: SubjectUpdateManyWithoutSpecialistsInput history: HistoryActionUpdateManyWithoutUserInput } @@ -3764,7 +3761,7 @@ input UserUpdateWithoutHistoryDataInput { answers: AnswerUpdateManyWithoutUserInput flags: FlagUpdateManyWithoutUserInput tags: TagUpdateManyWithoutUserInput - specialties: TagLabelUpdateManyWithoutSpecialistsInput + specialties: SubjectUpdateManyWithoutSpecialistsInput } input UserUpdateWithoutQuestionsDataInput { @@ -3778,7 +3775,7 @@ input UserUpdateWithoutQuestionsDataInput { answers: AnswerUpdateManyWithoutUserInput flags: FlagUpdateManyWithoutUserInput tags: TagUpdateManyWithoutUserInput - specialties: TagLabelUpdateManyWithoutSpecialistsInput + specialties: SubjectUpdateManyWithoutSpecialistsInput history: HistoryActionUpdateManyWithoutUserInput } @@ -3808,7 +3805,7 @@ input UserUpdateWithoutTagsDataInput { questions: QuestionUpdateManyWithoutUserInput answers: AnswerUpdateManyWithoutUserInput flags: FlagUpdateManyWithoutUserInput - specialties: TagLabelUpdateManyWithoutSpecialistsInput + specialties: SubjectUpdateManyWithoutSpecialistsInput history: HistoryActionUpdateManyWithoutUserInput } @@ -3961,9 +3958,9 @@ input UserWhereInput { tags_every: TagWhereInput tags_some: TagWhereInput tags_none: TagWhereInput - specialties_every: TagLabelWhereInput - specialties_some: TagLabelWhereInput - specialties_none: TagLabelWhereInput + specialties_every: SubjectWhereInput + specialties_some: SubjectWhereInput + specialties_none: SubjectWhereInput history_every: HistoryActionWhereInput history_some: HistoryActionWhereInput history_none: HistoryActionWhereInput diff --git a/server/src/helpers/diffTags.js b/server/src/helpers/diffTags.js index 2c01ac2da..5b6dd08f4 100644 --- a/server/src/helpers/diffTags.js +++ b/server/src/helpers/diffTags.js @@ -83,7 +83,7 @@ const diffTags = (ctx, oldCats, newCats, confId) => { promises.push( Promise.all( labelsToCreate.map(label => - ctx.prisma.mutation.createTagLabel({ + ctx.prisma.mutation.createSubject({ data: { name: label.name, order: label.order, @@ -123,7 +123,7 @@ const diffTags = (ctx, oldCats, newCats, confId) => { promises.push( Promise.all( labelsToUpdate.map(label => - ctx.prisma.mutation.updateTagLabel({ + ctx.prisma.mutation.updateSubject({ where: { id: label.id }, data: { name: label.name, order: label.order } }) @@ -141,7 +141,7 @@ const diffTags = (ctx, oldCats, newCats, confId) => { algoliaChanges.deleted.push(...labelsToDelete.map(l => l.name)) promises.push( Promise.all( - labelsToDelete.map(label => ctx.prisma.mutation.deleteTagLabel({ where: { id: label.id } })) + labelsToDelete.map(label => ctx.prisma.mutation.deleteSubject({ where: { id: label.id } })) ) ) diff --git a/server/src/resolvers/question.js b/server/src/resolvers/question.js index 54e1455b5..701ef214a 100644 --- a/server/src/resolvers/question.js +++ b/server/src/resolvers/question.js @@ -2,7 +2,7 @@ const { history, ctxUser, slugify, deleteCertifedFlagIfNoLongerApplicable } = re const { algolia, slack } = require('../integrations') // TMP_TAGS -const confTagLabels = ctx => +const confSubjects = ctx => ctx.prisma._meta.configuration.tagCategories.reduce((acc, cat) => acc.concat(cat.labels), []) module.exports = { @@ -11,7 +11,7 @@ module.exports = { }, Mutation: { createQuestionAndTags: async (_, { title, tags }, ctx, info) => { - const tagLabels = confTagLabels(ctx) + const subjects = confSubjects(ctx) const node = await ctx.prisma.mutation.createZNode( { @@ -25,9 +25,9 @@ module.exports = { }, tags: { create: tags - .filter(tagLabelId => !!tagLabels.find(label => label.id === tagLabelId)) - .map(tagLabelId => ({ - label: { connect: { id: tagLabelId } }, + .filter(subjectId => !!subjects.find(label => label.id === subjectId)) + .map(subjectId => ({ + label: { connect: { id: subjectId } }, user: { connect: { id: ctxUser(ctx).id } } })) }, @@ -54,7 +54,7 @@ module.exports = { model: 'Question', meta: { title, - tags: tags.map(id => tagLabels.find(label => label.id === id).name) + tags: tags.map(id => subjects.find(label => label.id === id).name) }, nodeId: node.id }) @@ -65,7 +65,7 @@ module.exports = { return ctx.prisma.query.question({ where: { id: node.question.id } }, info) }, updateQuestionAndTags: async (_, { id, title, previousTitle, tags }, ctx, info) => { - const tagLabels = confTagLabels(ctx) + const subjects = confSubjects(ctx) const node = ( await ctx.prisma.query.question( @@ -113,7 +113,7 @@ module.exports = { const tagsToRemove = oldLabels.filter(oldLabel => !newLabels.includes(oldLabel)) const mutationsToAdd = tagsToAdd - .filter(labelId => tagLabels.find(label => label.id === labelId)) + .filter(labelId => subjects.find(label => label.id === labelId)) .map(labelId => ctx.prisma.mutation.createTag({ data: { @@ -139,8 +139,8 @@ module.exports = { const meta = { tagsChanges: { - added: tagsToAdd.map(id => tagLabels.find(label => label.id === id).name), - removed: tagsToRemove.map(id => tagLabels.find(label => label.id === id).name) + added: tagsToAdd.map(id => subjects.find(label => label.id === id).name), + removed: tagsToRemove.map(id => subjects.find(label => label.id === id).name) } } diff --git a/server/src/schema.graphql b/server/src/schema.graphql index d7eeec8f7..959794de4 100644 --- a/server/src/schema.graphql +++ b/server/src/schema.graphql @@ -1,4 +1,4 @@ -# import ZNode, Question, Answer, Source, Flag, TagLabel, TagCategory, HistoryAction, BugReporting from './generated/prisma.graphql' +# import ZNode, Question, Answer, Source, Flag, Subject, TagCategory, HistoryAction, BugReporting from './generated/prisma.graphql' # import ZNodeOrderByInput, ZNodeConnection, ZNodeWhereUniqueInput from './generated/prisma.graphql' # import HistoryActionWhereInput from './generated/prisma.graphql' @@ -90,7 +90,7 @@ type User { email: String picture: String - specialties: [TagLabel!] + specialties: [Subject!] } type Configuration {