Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
vite-plugin-graphql-loader
Advanced tools
A Vite plugin for loading GraphQL .gql and .graphql files, based on graphql-tag/loader
yarn add -D vite-plugin-graphql-loader
or
npm i vite-plugin-graphql-loader --save-dev
In vite.config.ts
or vite.config.js
:
import { defineConfig } from "vite";
import graphqlLoader from "vite-plugin-graphql-loader";
export default defineConfig({
plugins: [graphqlLoader()],
});
Now you can import queries from .gql
or .graphql
files.
example.graphql
:
fragment ExampleFragment on example {
id
name
}
query ExampleQuery {
example {
...ExampleFragment
}
}
example.js
:
import ExampleQuery, { ExampleFragment } from "./example.graphql";
If you are using TypeScript, you will have to declare .gql
or .graphql
files:
graphql.d.ts
:
declare module "*.gql";
// Or if you aren't using fragments:
// declare module "*.gql" {
// const Query: import("graphql").DocumentNode;
// export default Query;
// }
FAQs
A Vite plugin for loading GraphQL files.
The npm package vite-plugin-graphql-loader receives a total of 27,064 weekly downloads. As such, vite-plugin-graphql-loader popularity was classified as popular.
We found that vite-plugin-graphql-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.