# @cdmbase/graphql-type-uri

> JSON scalar types for GraphQL.js

Latest version **4.0.0** (published 2024-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cdmbase/graphql-type-uri
pnpm add @cdmbase/graphql-type-uri
yarn add @cdmbase/graphql-type-uri
bun add @cdmbase/graphql-type-uri
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2024-12-16 |
| First published | 2019-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jimmy Jia |
| Maintainers | cdmbase |
| Keywords | graphql |

## Links

- npm: https://www.npmjs.com/package/@cdmbase/graphql-type-uri
- Repository: https://github.com/cdmbase/graphql-type-json
- Homepage: https://github.com/cdmbase/graphql-type-json#readme
- Issues: https://github.com/cdmbase/graphql-type-json/issues
- npm.io page: https://npm.io/package/@cdmbase/graphql-type-uri

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2024-12-16
- 3.0.0 — 2024-08-10
- 2.0.0 — 2021-05-30
- 0.5.0 — 2021-05-30
- 1.1.0 — 2020-09-21
- 1.0.0 — 2020-09-20
- 0.4.1 — 2019-07-10
- 0.4.0 — 2019-07-06
- 0.3.0 — 2019-06-10

## README

# graphql-type-uri 

URI scalar types for [GraphQL.js](https://github.com/graphql/graphql-js).


## Usage

This package exports a URI value scalar GraphQL.js type:

```js
import graphQLURI from '@cdmbase/graphql-type-uri';
```


These types can also be imported as follows using CommonJS:

```js
const { graphQLURI } = require('@cdmbase/graphql-type-uri');
```

### Programmatically-constructed schemas

You can use this in a programmatically-constructed schema as with any other scalar type:

```js
import graphQLURI from '@cdmbase/graphql-type-uri';

const GraphQLURI = graphQLURI('URI');
export default new GraphQLObjectType({
  name: 'MyType',

  fields: {
    myValue: { type: GraphQLURI },
  },
});
```

### SDL with [GraphQL-tools](https://github.com/apollographql/graphql-tools)

When using the SDL with GraphQL-tools, define `GraphQLURI` as the resolver for the appropriate scalar type in your schema:

```js
import { makeExecutableSchema } from 'graphql-tools';
import graphQLURI, from '@cdmbase/graphql-type-uri';

const GraphQLURI = graphQLURI('URI');
const typeDefs = `
scalar URI

type MyType {
  myValue: URI
}

# ...
`;

const resolvers = {
  URI: GraphQLURI,
};

export default makeExecutableSchema({ typeDefs, resolvers });
```

---
_Source: https://npm.io/package/@cdmbase/graphql-type-uri · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
