graphbrainz/src/types/url.js
Brian Beck f095cd4de7
Modernize dependencies, syntax, imports (#93)
* wip: Modernize dependencies, syntax, imports

* Use final release of ava-nock v2

* Update Travis config

* Remove Node 13 from test matrix

* Replace errorClass with parseErrorMessage in subclasses

* define exports, apply updated lint rules

* Remove markdown eslint plugin

* Update README

* v9.0.0-beta.1

* Add gql tag to exports

* v9.0.0-beta.2

* Bump ava-nock, add test

* Update dataloader loadMany usage

* Add modules note to README

* Add retry option to got calls
2021-04-15 21:34:29 -07:00

27 lines
849 B
JavaScript

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';
const { GraphQLObjectType, GraphQLNonNull } = GraphQL;
export const URL = new GraphQLObjectType({
name: 'URL',
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.`,
interfaces: () => [Node, Entity],
fields: () => ({
id,
mbid,
resource: {
type: new GraphQLNonNull(URLString),
description: 'The actual URL string.',
},
relationships,
}),
});
export const URLConnection = connectionWithExtras(URL);