2017-11-07 05:54:56 +00:00
|
|
|
|
import { GraphQLObjectType, GraphQLBoolean } from 'graphql/type'
|
2016-12-10 02:55:41 +00:00
|
|
|
|
import { Locale } from './scalars'
|
2016-11-26 01:38:32 +00:00
|
|
|
|
import { name, sortName, fieldWithID } from './helpers'
|
2016-08-08 07:54:06 +00:00
|
|
|
|
|
|
|
|
|
|
export default new GraphQLObjectType({
|
|
|
|
|
|
name: 'Alias',
|
2016-11-26 01:38:32 +00:00
|
|
|
|
description: `[Aliases](https://musicbrainz.org/doc/Aliases) are variant names
|
|
|
|
|
|
that are mostly used as search help: if a search matches an entity’s alias, the
|
2016-11-29 08:12:59 +00:00
|
|
|
|
entity will be given as a result – even if the actual name wouldn’t be.`,
|
2016-08-08 07:54:06 +00:00
|
|
|
|
fields: () => ({
|
2016-11-26 01:38:32 +00:00
|
|
|
|
name: {
|
|
|
|
|
|
...name,
|
|
|
|
|
|
description: 'The aliased name of the entity.'
|
|
|
|
|
|
},
|
|
|
|
|
|
sortName,
|
|
|
|
|
|
locale: {
|
2016-12-10 02:55:41 +00:00
|
|
|
|
type: Locale,
|
2016-11-26 01:38:32 +00:00
|
|
|
|
description: `The locale (language and/or country) in which the alias is
|
|
|
|
|
|
used.`
|
|
|
|
|
|
},
|
|
|
|
|
|
primary: {
|
|
|
|
|
|
type: GraphQLBoolean,
|
|
|
|
|
|
description: `Whether this is the main alias for the entity in the
|
|
|
|
|
|
specified locale (this could mean the most recent or the most common).`
|
|
|
|
|
|
},
|
|
|
|
|
|
...fieldWithID('type', {
|
|
|
|
|
|
description: `The type or purpose of the alias – whether it is a variant,
|
|
|
|
|
|
search hint, etc.`
|
|
|
|
|
|
})
|
2016-08-08 07:54:06 +00:00
|
|
|
|
})
|
|
|
|
|
|
})
|