UUID scalar type for GraphQL.js.
Usage
This package exports a UUID scalar GraphQL.js type:
;
Programmatically-constructed schemas
You can use this in a programmatically-constructed schema as with any other scalar type:
;; ;
graphql-tools
SDL withWhen using the SDL with graphql-tools, define GraphQLUUID
as the resolver for
the corresponding scalar type in your schema:
;; const typeDefs = `scalar UUID type MyType { myField: UUID}`; const resolvers = UUID: GraphQLUUID; 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.