Gathering detailed insights and metrics for @prismamedia/graphql-platform-scalars
Gathering detailed insights and metrics for @prismamedia/graphql-platform-scalars
Gathering detailed insights and metrics for @prismamedia/graphql-platform-scalars
Gathering detailed insights and metrics for @prismamedia/graphql-platform-scalars
npm install @prismamedia/graphql-platform-scalars
Typescript
Module System
Min. Node Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
9 Stars
545 Commits
7 Watchers
2 Branches
2 Contributors
Updated on Jun 30, 2025
Latest Version
2.1.0-rc.2
Package Id
@prismamedia/graphql-platform-scalars@2.1.0-rc.2
Unpacked Size
232.22 kB
Size
38.23 kB
File Count
167
Published on
Jun 30, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
5
GraphQL Platform is an OpenCRUD implementation
This
@prismamedia/graphql-platform
aims to provide a complete and flexible GraphQL implementation of the OpenCRUD specification. Given a set of nodes' definition, it will generate an executable GraphQL schema made easy to expose through an Apollo Server.
Requirements
with npm
1npm install --save @prismamedia/graphql-platform @prismamedia/graphql-platform-connector-mariadb
or with yarn
1yarn add @prismamedia/graphql-platform @prismamedia/graphql-platform-connector-mariadb
1import { 2 GraphQLPlatform, 3 OnEdgeHeadDeletion, 4} from '@prismamedia/graphql-platform'; 5import { MariaDBConnector } from '@prismamedia/graphql-platform-connector-mariadb'; 6import { randomUUID } from 'node:crypto'; 7 8export const ArticleStatusType = new GraphQLEnumType({ 9 name: 'ArticleStatus', 10 values: { 11 DRAFT: { value: 'draft' }, 12 PUBLISHED: { value: 'published' }, 13 }, 14}); 15 16export type MyUser = { 17 id: string; 18 name: string; 19 role?: 'ADMIN' | 'JOURNALIST'; 20}; 21 22export type MyContext = { 23 user?: MyUser; 24}; 25 26const gp = new GraphQLPlatform<MyContext>({ 27 nodes: { 28 Article: { 29 authorization({ user }, mutationType) { 30 if (user) { 31 switch (user.role) { 32 case 'ADMIN': 33 // They can do as they please 34 return true; 35 36 case 'JOURNALIST': 37 return mutationType 38 ? mutationType === utils.MutationType.CREATION 39 ? // They can "create" new articles 40 true 41 : mutationType === utils.MutationType.UPDATE 42 ? // They can "update" the articles they have created 43 { createdBy: { id: user.id } } 44 : // They cannot "delete" articles 45 false 46 : // They can "query" all the articles 47 true; 48 49 default: 50 // The authenticated users can "query" the published articles but cannot mutate anything 51 return mutationType ? false : { status: 'published' }; 52 } 53 } 54 55 // Un-authenticated users cannot access articles at all 56 return false; 57 }, 58 59 components: { 60 id: { 61 type: 'UUIDv4', 62 description: 'This UUID identifies an Article publicly', 63 nullable: false, 64 mutable: false, 65 66 creation: { defaultValue: () => randomUUID() }, 67 }, 68 status: { 69 type: ArticleStatusType, 70 nullable: false, 71 72 creation: { defaultValue: ArticleStatus.DRAFT }, 73 }, 74 title: { 75 type: 'NonEmptyTrimmedString', 76 nullable: false, 77 }, 78 category: { 79 kind: 'Edge', 80 head: 'Category', 81 onHeadDeletion: OnEdgeHeadDeletion.SET_NULL, 82 }, 83 createdBy: { 84 kind: 'Edge', 85 head: 'Author', 86 nullable: false, 87 mutable: false, 88 89 creation: { 90 public: false, 91 }, 92 }, 93 }, 94 uniques: [['id']], 95 }, 96 Category: { 97 components: { 98 id: { 99 type: 'UUIDv4', 100 description: 'This UUID identifies a Category publicly', 101 nullable: false, 102 mutable: false, 103 104 creation: { defaultValue: () => randomUUID() }, 105 }, 106 title: { 107 kind: 'Leaf', 108 type: 'NonEmptyTrimmedString', 109 nullable: false, 110 }, 111 }, 112 uniques: [['id']], 113 }, 114 Author: { 115 components: { 116 id: { 117 type: 'UUIDv4', 118 description: 'This UUID identifies an Author publicly', 119 nullable: false, 120 mutable: false, 121 122 creation: { defaultValue: () => randomUUID() }, 123 }, 124 name: { 125 kind: 'Leaf', 126 type: 'NonEmptyTrimmedString', 127 nullable: false, 128 }, 129 }, 130 uniques: [['id']], 131 }, 132 }, 133 134 connector: (gp) => new MariaDBConnector(gp), 135});
Given the gp
instance above:
1import { ApolloServerIntegration } from '@prismamedia/graphql-platform-integration-apollo-server'; 2 3// `server` is an Apollo Server instance 4const server = new ApolloServerIntegration(gp); 5 6// you can now expose it as you wish, AWS Lambda, ExpressJS, ...
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no SAST tool detected
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
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