2016-08-20 05:59:32 +00:00
|
|
|
import { GraphQLObjectType, GraphQLNonNull } from 'graphql/type'
|
2016-08-31 06:33:29 +00:00
|
|
|
import Node from './node'
|
2016-08-20 05:59:32 +00:00
|
|
|
import Entity from './entity'
|
|
|
|
|
import { URLString } from './scalars'
|
2016-11-28 13:49:04 +00:00
|
|
|
import { id, mbid, relationships, connectionWithCount } from './helpers'
|
2016-08-20 05:59:32 +00:00
|
|
|
|
|
|
|
|
const URL = new GraphQLObjectType({
|
|
|
|
|
name: 'URL',
|
2016-11-26 01:38:32 +00:00
|
|
|
description: `A [URL](https://musicbrainz.org/doc/URL) pointing to a resource
|
|
|
|
|
external to MusicBrainz, i.e. an official homepage, a site where music can be
|
|
|
|
|
acquired, an entry in another database, etc.`,
|
2016-08-31 06:33:29 +00:00
|
|
|
interfaces: () => [Node, Entity],
|
2016-08-20 05:59:32 +00:00
|
|
|
fields: () => ({
|
|
|
|
|
id,
|
2016-08-31 06:33:29 +00:00
|
|
|
mbid,
|
2016-11-26 01:38:32 +00:00
|
|
|
resource: {
|
|
|
|
|
type: new GraphQLNonNull(URLString),
|
|
|
|
|
description: 'The actual URL string.'
|
|
|
|
|
},
|
|
|
|
|
relationships
|
2016-08-20 05:59:32 +00:00
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
2016-11-28 13:49:04 +00:00
|
|
|
export const URLConnection = connectionWithCount(URL)
|
2016-08-20 05:59:32 +00:00
|
|
|
export default URL
|