<commit_before>import { GraphQLObjectType, GraphQLBoolean, GraphQLInt } from "graphql"
import { totalViaLoader } from "lib/total"

const ArtistStatusesType = new GraphQLObjectType({
  name: "ArtistStatuses",
  fields: {
    artists: {
      type: GraphQLBoolean,
      resolve: (
        { id },
        options,
        request,
        { rootValue: { relatedMainArtistsLoader } }
      ) =>
        totalViaLoader(
          relatedMainArtistsLoader,
          {},
          { exclude_artists_without_artworks: true, artist: [id] }
        ).then(count => count > 0),
    },
    articles: {
      type: GraphQLBoolean,
      resolve: ({ _id }, options, request, { rootValue: { articlesLoader } }) =>
        articlesLoader({
          artist_id: _id,
          published: true,
          limit: 0,
          count: true,
        }).then(({ count }) => count > 0),
    },
    artworks: {
      type: GraphQLBoolean,
      resolve: ({ published_artworks_count }) => published_artworks_count > 0,
    },
    auction_lots: {
      type: GraphQLBoolean,
      resolve: ({ display_auction_link, hide_auction_link }) => {
        return display_auction_link && !hide_auction_link
      },
    },
    biography: {
      type: GraphQLBoolean,
      resolve: ({ _id }, options, request, { rootValue: { articlesLoader } }) =>
        articlesLoader({
          published: true,<commit_msg>[BUGFIX artist] Fix issue where status shows article erroniously<commit_after>import { GraphQLObjectType, GraphQLBoolean, GraphQLInt } from "graphql"
import { totalViaLoader } from "lib/total"

const ArtistStatusesType = new GraphQLObjectType({
  name: "ArtistStatuses",
  fields: {
    artists: {
      type: GraphQLBoolean,
      resolve: (
        { id },
        options,
        request,
        { rootValue: { relatedMainArtistsLoader } }
      ) =>
        totalViaLoader(
          relatedMainArtistsLoader,
          {},
          { exclude_artists_without_artworks: true, artist: [id] }
        ).then(count => count > 0),
    },
    articles: {
      type: GraphQLBoolean,
      resolve: ({ _id }, options, request, { rootValue: { articlesLoader } }) =>
        articlesLoader({
          artist_id: _id,
          published: true,
          in_editorial_feed: true,
          limit: 0,
          count: true,
        }).then(({ count }) => {
          return count > 0
        }),
    },
    artworks: {
      type: GraphQLBoolean,
      resolve: ({ published_artworks_count }) => published_artworks_count > 0,
    },
    auction_lots: {
      type: GraphQLBoolean,
      resolve: ({ display_auction_link, hide_auction_link }) => {
        return display_auction_link && !hide_auction_link
      },
    },
    biography: {
      type: GraphQLBoolean,
      resolve: ({ _id }, options, request, { rootValue: { articlesLoader } }) =>
        articlesLoader({
          published: true,
{'fraction_non_alphanumeric': 0.11756521739130435, 'fraction_numerical': 0.002782608695652174, 'mean_word_length': 2.2906178489702516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '98529', 'n_tokens_mistral': 843, 'n_tokens_neox': 840, 'n_words': 180}