
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
graph-api-client
Advanced tools
JS Library created to simplify using of GraphQL by using a defined structure for queries and mutations, instead of passing raw strings to the API handler
JS Library created to simplify using of GraphQL by using a defined structure for queries and mutations, instead of passing raw strings to the API handler
Just create an instance of the GraphAPIClient
object and it will take care of the rest
class GraphAPIClient {
constructor(
axiosRequestConfig: AxiosRequestConfig = {},
clientConfig: IGraphClientConfig = defaultClientConfig
) {
this.axios = axios.create(axiosRequestConfig);
this.config = Object.assign({}, defaultClientConfig, clientConfig);
}
}
the axiosRequestConfig
parameter sets default parameters for the internal axios instance, while clientConfig
sets the default API request payload keys, by default {query, variables}
Just call client.query
or client.mutation
to enjoy the magic
public query<T>(path: string = '/graphql', requests: GraphQLRequest[], config: AxiosRequestConfig = {}): Promise<T> {
const body = this.collectRequestBody('query', requests);
return this.post<T>(path, body, config);
}
public mutate<T>(path: string = '/graphql', requests: GraphQLRequest[], config: AxiosRequestConfig = {}): Promise<T> {
const body = this.collectRequestBody('mutation', requests);
return this.post<T>(path, body, config);
}
Both GraphQL queries and mutations are being generated by the graphql-request-generator
library, which I made.
To read about request generation check the repo's README
FAQs
JS Library created to simplify using of GraphQL by using a defined structure for queries and mutations, instead of passing raw strings to the API handler
The npm package graph-api-client receives a total of 2 weekly downloads. As such, graph-api-client popularity was classified as not popular.
We found that graph-api-client 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
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.