Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
graphql-tag-loader-register
Advanced tools
Readme
Require .graphql
files with Node & Typescript.
You may want to add "ignore": [".graphql", ".graphqls"]
to your .babelrc if you use babel@6. I hear that babel@7 fixes this by using the same dependency this module does ;)
Supports node@>=6
npm i --save graphql graphql-tag graphql-tag-loader-register [@types/graphql]
const register = require('graphql-tag-loader-register')
register()
const schema = require('./schema.graphqls')
console.log(schema) // schema document ast
const query = require('./query.graphql')
console.log(query) // query document ast
Also supports ES6 imports and TypeScript with a default export.
import register from 'graphql-tag-register'
register()
If using TypeScript, slightly more work is required. My only use case right now involves ts-node, and to get that to work I did the following:
// entry.js
process.env.TS_NODE_IGNORE = '\.graphqls?$'
require('ts-node/register')
// graphql.ts
import register from 'graphql-tag-loader-register'
register()
import {DocumentNode} from 'graphql'
const schema = require('schema.graphqls') as DocumentNode
const query = require('schema.graphql') as DocumentNode
If somebody can improve the module by contributing working configs or figuring out how to declare this globally or more succinctly, please do!
FAQs
Require `.graphql` files with Node & Typescript.
We found that graphql-tag-loader-register 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.