<commit_before>import _ from 'lodash';
import artsy from '../lib/artsy';
import Artwork from './artwork';
import PartnerShow from './partner_show';
import {
  GraphQLObjectType,
  GraphQLBoolean,
  GraphQLString,
  GraphQLNonNull,
  GraphQLList,
  GraphQLInt,
  GraphQLEnumType
} from 'graphql';

let ArtistType = new GraphQLObjectType({
  name: 'Artist',
  fields: () => ({
    id: {
      type: GraphQLString
    },
    href: {
      type: GraphQLString,
      resolve: (artist) => `/artist/${artist.id}`
    },
    sortable_id: {
      type: GraphQLString,
      description: 'Use this attribute to sort by when sorting a collection of Artists'
    },
    name: {
      type: GraphQLString
    },
    birthday: {
      type: GraphQLString
    },
    artworks: {
      type: new GraphQLList(Artwork.type),
      args: {
        size: {
          type: GraphQLInt,
          description: 'The number of Artworks to return'
        },
        sort: {<commit_msg>Adds more artist attributes required for the above the fold section of the artist page<commit_after>import _ from 'lodash';
import artsy from '../lib/artsy';
import Artwork from './artwork';
import PartnerShow from './partner_show';
import {
  GraphQLObjectType,
  GraphQLBoolean,
  GraphQLString,
  GraphQLNonNull,
  GraphQLList,
  GraphQLInt,
  GraphQLEnumType
} from 'graphql';

let ArtistType = new GraphQLObjectType({
  name: 'Artist',
  fields: () => ({
    id: {
      type: GraphQLString
    },
    href: {
      type: GraphQLString,
      resolve: (artist) => `/artist/${artist.id}`
    },
    sortable_id: {
      type: GraphQLString,
      description: 'Use this attribute to sort by when sorting a collection of Artists'
    },
    name: {
      type: GraphQLString
    },
    years: {
      type: GraphQLString
    },
    nationality: {
      type: GraphQLString
    },
    is_shareable: {
      type: GraphQLBoolean,
      resolve: (artist) => artist.published_artworks_count > 0
    },
    counts: {
      type: new GraphQLObjectType({
        name: 'counts',
        fields: {
          artworks: {
            type: GraphQLInt,
            resolve: ({ published_artworks_count }) => published_artworks_count
          },
          follows: {
            type: GraphQLInt,
            resolve: ({ follow_count }) => follow_count
          },
          auction_lots: {
            type: GraphQLInt,
            resolve: ({ auction_lots_count }) => auction_lots_count
          }
        }
      }),
      resolve: (artist) => artist
    },
    artworks: {
      type: new GraphQLList(Artwork.type),
      args: {
        size: {
          type: GraphQLInt,
          description: 'The number of Artworks to return'
        },
        sort: {
{'fraction_non_alphanumeric': 0.11037527593818984, 'fraction_numerical': 0.0003679175864606328, 'mean_word_length': 2.217751479289941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1951278', 'n_tokens_mistral': 833, 'n_tokens_neox': 839, 'n_words': 210}