graphbrainz/src/types/url.js

28 lines
849 B
JavaScript
Raw Normal View History

import GraphQL from 'graphql';
import { Node } from './node.js';
import { Entity } from './entity.js';
import { URLString } from './scalars.js';
import { id, mbid, connectionWithExtras } from './helpers.js';
import { relationships } from './relationship.js';
2016-08-20 05:59:32 +00:00
const { GraphQLObjectType, GraphQLNonNull } = GraphQL;
export const URL = new GraphQLObjectType({
2016-08-20 05:59:32 +00:00
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.',
2016-11-26 01:38:32 +00:00
},
relationships,
}),
});
2016-08-20 05:59:32 +00:00
export const URLConnection = connectionWithExtras(URL);