All Projects → olistic → graphql-type-uuid

olistic / graphql-type-uuid

Licence: MIT license
UUID scalar type for GraphQL.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to graphql-type-uuid

uid
Provides an object-oriented API to generate and represent UIDs.
Stars: ✭ 315 (+1269.57%)
Mutual labels:  uuid
go-ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Go - Please use https://github.com/oklog/ulid
Stars: ✭ 31 (+34.78%)
Mutual labels:  uuid
uuid-mongodb
📇 Generates and parses MongoDB BSON UUIDs
Stars: ✭ 94 (+308.7%)
Mutual labels:  uuid
uuid
A decentralized favorites and bookmarks based on Git hosting
Stars: ✭ 70 (+204.35%)
Mutual labels:  uuid
uuids
UUID library for Nim
Stars: ✭ 28 (+21.74%)
Mutual labels:  uuid
ruuid
A fast uuid generator in Python using Rust
Stars: ✭ 19 (-17.39%)
Mutual labels:  uuid
pure-uuid
Pure JavaScript Based Universally Unique Identifiers (UUID)
Stars: ✭ 60 (+160.87%)
Mutual labels:  uuid
fuuid
Functional UUIDs for Python.
Stars: ✭ 145 (+530.43%)
Mutual labels:  uuid
sqlike
Golang Sequel ORM that supports Enum, JSON, Spatial, and many more
Stars: ✭ 18 (-21.74%)
Mutual labels:  uuid
id-mask
IDMask is a Java library for masking internal ids (e.g. from your DB) when they need to be published to hide their actual value and to prevent forging. It has support optional randomisation has a wide support for various Java types including long, UUID and BigInteger. This library bases its security on strong cryptographic primitives.
Stars: ✭ 39 (+69.57%)
Mutual labels:  uuid
ugql
🚀GraphQL.js over HTTP with uWebSockets.js
Stars: ✭ 27 (+17.39%)
Mutual labels:  graphql-js
graphql-query-whitelist
GraphQL query whitelisting middleware
Stars: ✭ 17 (-26.09%)
Mutual labels:  graphql-js
graphql-resolver-cache
Caching for Graphql Resolvers
Stars: ✭ 18 (-21.74%)
Mutual labels:  graphql-js
rs-nuid
NATS unique identifiers
Stars: ✭ 19 (-17.39%)
Mutual labels:  uuid
graphcraft
Rapildy build and extend GraphQL API based on Sequelize models. This library helps you focus on business logic while taking care of GraphQL schema automatically.
Stars: ✭ 50 (+117.39%)
Mutual labels:  graphql-js
domain
A dependency-free package to help building a business domain layer
Stars: ✭ 33 (+43.48%)
Mutual labels:  uuid
graphql-spotify
GraphQL Schema And Resolvers For Spotify Web API
Stars: ✭ 55 (+139.13%)
Mutual labels:  graphql-js
gobarber-api-gostack11
API GoBarber / NodeJS / Express / Typescript / SOLID
Stars: ✭ 39 (+69.57%)
Mutual labels:  uuid
rulid.rs
Rust Universally Unique Lexicographically Sortable Identifier
Stars: ✭ 40 (+73.91%)
Mutual labels:  uuid
fastuuid
FastUUID is a library which provides CPython bindings to Rust's UUID library
Stars: ✭ 83 (+260.87%)
Mutual labels:  uuid

graphql-type-uuid npm

UUID scalar type for GraphQL.js.

Travis Codecov

Usage

This package exports a UUID scalar GraphQL.js type:

import GraphQLUUID from 'graphql-type-uuid';

This type can also be imported as follows using CommonJS:

const GraphQLUUID = require('graphql-type-uuid');

GraphQLUUID can represent any UUID version specified in RFC 4122.

Programmatically-constructed schemas

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

import { GraphQLObjectType } from 'graphql';
import GraphQLUUID from 'graphql-type-uuid';

export default new GraphQLObjectType({
  name: 'MyType',
  fields: {
    myField: { type: GraphQLUUID },
  },
});

SDL with graphql-tools

When using the SDL with graphql-tools, define GraphQLUUID as the resolver for the corresponding scalar type in your schema:

import { makeExecutableSchema } from 'graphql-tools';
import GraphQLUUID from 'graphql-type-uuid';

const typeDefs = `
scalar UUID

type MyType {
  myField: UUID
}
`;

const resolvers = {
  UUID: GraphQLUUID,
};

export default makeExecutableSchema({ typeDefs, resolvers });

Related

If you happen to be looking for a JSON scalar GraphQL.js type, please check graphql-type-json, in which this project is heavily inspired.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].