Gathering detailed insights and metrics for graphql-type-json
Gathering detailed insights and metrics for graphql-type-json
Gathering detailed insights and metrics for graphql-type-json
Gathering detailed insights and metrics for graphql-type-json
npm install graphql-type-json
Typescript
Module System
98.9
Supply Chain
92
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
300,097,362
Last Day
53,447
Last Week
996,280
Last Month
4,416,441
Last Year
50,678,127
MIT License
985 Stars
292 Commits
55 Forks
12 Watchers
28 Branches
8 Contributors
Updated on Mar 22, 2025
Minified
Minified + Gzipped
Latest Version
0.3.2
Package Id
graphql-type-json@0.3.2
Size
3.51 kB
Published on
Jun 10, 2020
Cumulative downloads
Total Downloads
Last Day
-10.2%
53,447
Compared to previous day
Last Week
-10.9%
996,280
Compared to previous week
Last Month
-0.9%
4,416,441
Compared to previous month
Last Year
-4.4%
50,678,127
Compared to previous year
JSON scalar types for GraphQL.js.
This package exports a JSON value scalar GraphQL.js type:
1import GraphQLJSON from 'graphql-type-json';
It also exports a JSON object scalar type:
1import { GraphQLJSONObject } from 'graphql-type-json';
These types can also be imported as follows using CommonJS:
1const { GraphQLJSON, GraphQLJSONObject } = require('graphql-type-json');
GraphQLJSON
can represent any JSON-serializable value, including scalars, arrays, and objects. GraphQLJSONObject
represents specifically JSON objects, which covers many practical use cases for JSON scalars.
You can use this in a programmatically-constructed schema as with any other scalar type:
1import GraphQLJSON, { GraphQLJSONObject } from 'graphql-type-json'; 2 3export default new GraphQLObjectType({ 4 name: 'MyType', 5 6 fields: { 7 myValue: { type: GraphQLJSON }, 8 myObject: { type: GraphQLJSONObject }, 9 }, 10});
When using the SDL with GraphQL-tools, define GraphQLJSON
as the resolver for the appropriate scalar type in your schema:
1import { makeExecutableSchema } from 'graphql-tools'; 2import GraphQLJSON, { GraphQLJSONObject } from 'graphql-type-json'; 3 4const typeDefs = ` 5scalar JSON 6scalar JSONObject 7 8type MyType { 9 myValue: JSON 10 myObject: JSONObject 11} 12 13# ... 14`; 15 16const resolvers = { 17 JSON: GraphQLJSON, 18 JSONObject: GraphQLJSONObject, 19}; 20 21export default makeExecutableSchema({ typeDefs, resolvers });
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
38 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More