
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@gql-unicorn/runtime
Advanced tools
Name of this package is a combination of GraphQl
+ unicorn
(beacuse this is a 🦄 )
[!IMPORTANT] Currently in development, this info is potentially wrong or incomplete.
[!NOTE] Generates types from GraphQL schema and a very minimal runtime information from schema for builder.
npm install @gql-unicorn/cli --save-dev
npm install @gql-unicorn/runtime --save
import { Query, Type, Fragment, $ } from "genrated-pacakge-name"
const fragment = Fragment("fragmentName").News.author(q => q.id.name)
Query.articles()
.id
.name
.tags({count: $.count}, q => q.id.name)
.another_field
.$on(fragment)
.$on(Type.Blog.some_field)
.$build()
Query.articles()
.id
.name
.tags({count: $.count}, q => q.id.name)
.author(q => q.id.name)
.$build()
import { Query, $ } from "genrated-pacakge-name"
const GetUser = Query.users({id: $("userId")})
.id
.name
.articles(q => q.id.name)
.$build()
type SUser = Selected<User, ["id", "name", {"articles": ["id", "name"]}]>
// SUser = {id: string; name: string; articles: {id: string; name: string}[]}
import { Mutation, $ } from "genrated-pacakge-name"
const CreateUser = Mutation.createUser({...}).id.name
import { Type } from "genrated-pacakge-name"
if (Type.Worker.$is(user)) {
// ...
}
import { Query, Type, TypeOf, $ } from "genrated-pacakge-name"
const GetUser = Query.users({id: $("userId")})("id", "name")
type User = TypeOf<typeof GetUser>
import { $, Query, UserFilter } from "genrated-pacakge-name"
const q = Query.users({ filter: $("filterVar"), offset: $("offsetVar"), count: $("countVar") })
.id
.name
.$build()
type Variables = {filterVar: UserFilter, offsetVar: number, countVar: number}
// or simplified version (this is the default, so it can simplify more to: Query.users()...)
const q = Query.users($)
.id
.name
.$build()
type Variables = {filter: UserFilter, offset: number, count: number}
// or with shorthands
const q = Query.users({ filter: $("filterVar"), offset: $, count: $ })
.id
.name
.$build()
type Variables = {filterVar: UserFilter, offset: number, count: number}
const q = Query.users($)
.id
.articles({count: $}, q => id.title)
.$build()
type Variables = {filter: UserFilter, offset: number, count: number, articles__count: number}
Compatible with every packages that ghandle TypedDocumentNode
To create TypedDocumentNode
use $build
function
Compatible with every packages that handle GraphQL queries in string format
To create GraphQL string use $gql
function
FAQs
Unknown package
We found that @gql-unicorn/runtime demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.