{"size": 2148, "ext": "js", "max_stars_repo_path": "graphbrainz/src/types/place.js", "max_stars_repo_name": "meimecaj/musicquery", "max_stars_repo_stars_event_min_datetime": "2016-11-26T02:43:51.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-03T05:04:42.000Z", "max_issues_repo_path": "graphbrainz/src/types/place.js", "max_issues_repo_name": "meimecaj/musicquery", "max_issues_repo_issues_event_min_datetime": "2016-11-26T07:45:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-10T23:18:03.000Z", "max_forks_repo_path": "graphbrainz/src/types/place.js", "max_forks_repo_name": "meimecaj/musicquery", "max_forks_repo_forks_event_min_datetime": "2016-11-27T18:38:17.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-30T18:06:57.000Z"}
{"max_stars_count": 142, "max_issues_count": 93, "max_forks_count": 35, "avg_line_length": 26.85, "max_line_length": 80, "alphanum_fraction": 0.6559590317}
import GraphQL from 'graphql';
import { Node } from './node.js';
import { Entity } from './entity.js';
import { Degrees } from './scalars.js';
import { Area } from './area.js';
import {
  id,
  mbid,
  name,
  disambiguation,
  fieldWithID,
  connectionWithExtras,
  linkedQuery,
} from './helpers.js';
import { aliases } from './alias.js';
import { collections } from './collection.js';
import { events } from './event.js';
import { lifeSpan } from './life-span.js';
import { relationships } from './relationship.js';
import { tags } from './tag.js';

const { GraphQLObjectType, GraphQLString } = GraphQL;

export const Coordinates = new GraphQLObjectType({
  name: 'Coordinates',
  description: 'Geographic coordinates described with latitude and longitude.',
  fields: () => ({
    latitude: {
      type: Degrees,
      description:
        'The north–south position of a point on the Earth’s surface.',
    },
    longitude: {
      type: Degrees,
      description: 'The east–west position of a point on the Earth’s surface.',
    },
  }),
});

export const Place = new GraphQLObjectType({
  name: 'Place',
  description: `A [place](https://musicbrainz.org/doc/Place) is a venue, studio,
or other place where music is performed, recorded, engineered, etc.`,
  interfaces: () => [Node, Entity],
  fields: () => ({
    id,
    mbid,
    name,
    disambiguation,
    aliases,
    address: {
      type: GraphQLString,
      description: `The address describes the location of the place using the
standard addressing format for the country it is located in.`,
    },
    area: {
      type: Area,
      description: `The area entity representing the area, such as the city, in
which the place is located.`,
    },
    coordinates: {
      type: Coordinates,
      description: 'The geographic coordinates of the place.',
    },
    lifeSpan,
    ...fieldWithID('type', {
      description: `The type categorises the place based on its primary
function.`,
    }),
    events,
    relationships,
    collections,
    tags,
  }),
});

export const PlaceConnection = connectionWithExtras(Place);

export const places = linkedQuery(PlaceConnection);
