2.0.5 • Published 6 years ago

graphql-url v2.0.5

Weekly downloads
207
License
MIT
Repository
github
Last release
6 years ago

graphql-url

graphql scalar validating that it's a correct url

Installation

yarn install graphql-url [--dev]

Usage

This module exports 3 different scalars - one for absolute urls (GraphQLAbsoluteUrl), one for relative urls (GraphQLRelativeUrl) and one for either relative or absolute urls (GraphQLUrl);

import { GraphQLUrl } from 'graphql-url';

const schema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: 'RootQueryType',
    fields: {
      foo: {
        type: GraphQLUrl,
        resolve() {
          return 'https://foo.com/bar';
        }
      }
    }
  })
});
2.0.5

6 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago