Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
The spec-compliant & magical GraphQL query language engine in the TypeScript type system
gql.tada
is a GraphQL document authoring library, inferring the result and variables types
of GraphQL queries and fragments in the TypeScript type system. It derives the types for your
GraphQL queries on the fly allowing you to write type-safe GraphQL documents quickly.
In short, gql.tada
,
Since this is all done in the TypeScript type system and type checker, this all happens while you edit your GraphQL front-end code and is always accurate.
import { graphql } from 'gql.tada';
import { myIntrospectionQuery } from './fixtures/introspection';
// We can declare our introspected schema once globally
declare module 'gql.tada' {
interface setupSchema {
introspection: typeof myIntrospectionQuery;
}
}
// Creates fragment documents
const fragment = graphql(`
fragment HelloWorld extends Query {
hello
world
}
`);
// Creates queries, optionally accepting a list of fragments for fragment spreads
const query = graphql(
`
{
hello
...HelloWorld
}
`,
[fragment]
);
Install gql.tada
using your project’s package manager,
npm i gql.tada
pnpm add graphql
yarn add gql.tada
bun add graphql
gql.tada
infers the types of your queries. However, it can’t provide you with editor feedback,
like autocompletion, diagnostics & errors, and hover information inside GraphQL queries.
For the best experience, it’s recommended to install GraphQLSP
to supplement these features.
Install @0no-co/graphqlsp
as a dev dependency,
npm i -D gql.tada
pnpm add -D graphql
yarn add --dev gql.tada
bun add --dev graphql
Then, update your tsconfig.json
to enable the graphqlsp
plugin in your TypeScript server,
tsconfig.json
{
"compilerOptions": {
+ "plugins": [
+ {
+ "name": "@0no-co/graphqlsp",
+ "schema": "./schema.graphql"
+ }
+ ]
}
}
Note: If you are using VSCode, you may want to update your
.vscode/config.json
file to use the use the workspace version of TypeScript automatically..vscode/config.json
{ + "typescript.tsdk": "node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true }
FAQs
The spec-compliant & magical GraphQL query language engine in the TypeScript type system
The npm package gql.tada receives a total of 14,602 weekly downloads. As such, gql.tada popularity was classified as popular.
We found that gql.tada 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.