Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
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
apollo@2.16.0
, apollo-codegen-swift@0.34.0
, apollo-language-server@1.13.0
, apollo-tools@0.4.0
, vscode-apollo@1.8.0
apollo@2.16.0
service:list
and tests #1358 and header #1377service:list
test to use a simulated time to prevent relative dates causing snapshot failures #1374service:check
to support --markdown
and --json
flags for federated schema #1378service:check
to include graphCompositionId
in query params for UI #1401apollo-codegen-swift@0.34.0
apollo-language-server@1.13.0
apollo-tools@0.4.0
subscribe
in buildServiceDefinition
and add type in resolverMap
#1047vscode-apollo@1.8.0
<<-GRAPHQL...GRAPHQL
heredoc. #1304FAQs
Generate client code based on a GraphQL schema and query documents
The npm package graphql-codegen receives a total of 12,599 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.