@flesch/graphql-url
A url scalar for graphql
Last updated 2 years ago by flesch .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @flesch/graphql-url 
SYNC missed versions from official npm registry.

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';
        }
      }
    }
  })
});

Current Tags

  • 2.0.5                                ...           latest (2 years ago)

1 Versions

  • 2.0.5                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |