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.
graphql-codegen
Advanced tools
Generate client code based on a GraphQL schema and query documents
This is a tool to generate client code based on a GraphQL schema and query documents.
It currently only generates Swift code, and only for a subset of GraphQL queries. Most importantly, fragments are only supported if their type condition matches their parent type exactly. See Apollo iOS for details on the proposed mapping from GraphQL results to Swift types, as well as runtime support for performing queries.
Apollo iOS Quickstart is a sample Xcode project that makes it easy to get started with a generated API for your own schema and queries.
If you want to experiment with the tool, you can install the apollo-codegen
command globally:
npm install apollo-codegen -g
To download a GraphQL schema by sending an introspection query to a server:
apollo-codegen download-schema http://localhost:8080/graphql --output GitHuntAPI/Definitions/schema.json
You can use the header
option to add additional HTTP headers to the request. For example, to include an authentication token, use --header "Authorization: Bearer <token>"
.
To generate Swift code from a set of query definitions in .graphql
files:
apollo-codegen generate GitHuntAPI/Definitions/**/*.graphql --schema GitHuntAPI/Definitions/schema.json --output GitHuntAPI/GitHuntAPI.swift
FAQs
Generate client code based on a GraphQL schema and query documents
The npm package graphql-codegen receives a total of 11,281 weekly downloads. As such, graphql-codegen popularity was classified as popular.
We found that graphql-codegen 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
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.