
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
normalize-graph-ql
Advanced tools
Uses the normalizr library to normalize a GraphQL query response.
Example of use:
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types { ...FullType }
directives {
name
description
locations
args { ...InputValue }
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args { ...InputValue }
type { ...TypeRef }
isDeprecated
deprecationReason
}
inputFields { ...InputValue }
interfaces { ...TypeRef }
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes { ...TypeRef }
}
fragment InputValue on __InputValue {
name
description
type { ...TypeRef }
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
schema.json.response.json.import { normalize } from 'normalizr';
import schema from './schema.json';
import response from './response.json';
import querySchema from 'normalize-graph-ql';
const query = querySchema(schema, `
query {
account(id: 1) {
id
email
lastName
middleName
firstName
webinars {
url
webinar {
id
title
ticket {
id
price
}
}
}
}
}
`);
var result = normalize(response, query.schema);
Result:
{
"entities": {
"Ticket": {
"1": {
"id": 1,
"price": 500
}
},
"Webinar": {
"1": {
"id": 1,
"title": "some title",
"ticket": 1
}
},
"Account": {
"1": {
"id": 1,
"email": "some@email.com",
"lastName": "some lastName",
"middleName": "some middleName",
"firstName": "some firstName",
"webinars": [
{
"url": "some URL",
"webinar": 1
}
]
}
}
},
"result": {
"data": {
"account": 1
}
}
}
FAQs
normalize graphql schema
The npm package normalize-graph-ql receives a total of 2 weekly downloads. As such, normalize-graph-ql popularity was classified as not popular.
We found that normalize-graph-ql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.